[{"data":1,"prerenderedAt":1837},["ShallowReactive",2],{"/wordpress/coding-standards/":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"head":10,"created":25,"tags":29,"chapters":34,"thumb":37,"contact":38,"feedback":38,"lead":38,"list":6,"index":6,"sitemap":6,"body":39,"_type":1831,"_id":1832,"_source":1833,"_file":1834,"_stem":1835,"_extension":1836},"/wordpress/coding-standards","wordpress",false,"","How to Protect Project's Budget With WordPress Coding Standards?","Article discusses the importance of WordPress Coding Standards as the solution to prevent problems that can make your business lose real money.",{"title":11,"link":12,"meta":16},"How to Protect Project's Budget With WordPress Coding Standards? | pragmate.dev",[13],{"rel":14,"href":15},"canonical","https://pragmate.dev/wordpress/coding-standards/",[17,20,23,26],{"name":18,"content":19},"twitter:creator","@przemekhernik",{"name":21,"content":22},"author","Przemysław Hernik",{"name":24,"content":25},"article:published_time","2026-05-27",{"name":27,"content":28},"og:image","https://cdn.pragmate.dev/wp-content/uploads/2026/05/a512a7b1-f9a0-4b54-9d9f-b340f07d325f.jpg",{"time":30,"level":31,"stack":32},"9 min","Easy",[33],"WordPress",[35,36],"/wordpress/coding-standards/","/wordpress/coding-style/","code",true,{"type":40,"children":41,"toc":1825},"root",[42,49,81,92,132,136,140,147,167,440,466,471,483,495,498,504,529,709,729,733,743,1082,1085,1091,1104,1222,1242,1246,1264,1372,1375,1381,1410,1442,1469,1720,1723,1750,1774,1811,1814,1819],{"type":43,"tag":44,"props":45,"children":48},"element","prose-video",{"thumbnail":46,"url":47},"https://cdn.pragmate.dev/wp-content/uploads/2025/05/f7f6b08e-8a35-486b-b080-2ee3b8fdbfe7.jpg","https://www.youtube-nocookie.com/embed/iPtso6YB2ak",[],{"type":43,"tag":50,"props":51,"children":52},"p",{},[53,56,63,65,71,73,79],{"type":54,"value":55},"text","What has a bigger impact on a project's success - the code that meets the ",{"type":43,"tag":57,"props":58,"children":60},"a",{"href":59},"/environment/linting/",[61],{"type":54,"value":62},"visual rules",{"type":54,"value":64}," or a system crashing from heavy ",{"type":43,"tag":37,"props":66,"children":68},{"className":67},[],[69],{"type":54,"value":70},"WP_Queries",{"type":54,"value":72},"? Most developers would likely prioritize ",{"type":43,"tag":57,"props":74,"children":76},{"href":75},"/wordpress/performance/improve-performance-with-simple-architectural-decisions/",[77],{"type":54,"value":78},"performance",{"type":54,"value":80},", as system failures can be far more damaging for the brand reputation or client's experience.",{"type":43,"tag":50,"props":82,"children":83},{},[84,90],{"type":43,"tag":85,"props":86,"children":87},"strong",{},[88],{"type":54,"value":89},"The way the code looks like certainly affects the final results, but is is not as significant as issues that prevent users from using the platform.",{"type":54,"value":91}," Some businesses lose significant revenue for every minute their website is down, so as developers, it's our responsibility to do everything we can to prevent this, just as we write the code.",{"type":43,"tag":50,"props":93,"children":94},{},[95,97,102,104,130],{"type":54,"value":96},"In ",{"type":43,"tag":57,"props":98,"children":99},{"href":36},[100],{"type":54,"value":101},"my first video about WordPress Coding Standards",{"type":54,"value":103},", I focused too much on the visual side of the code - preferences that might differ from person to person. But ",{"type":43,"tag":85,"props":105,"children":106},{},[107,109,114,116,122,124],{"type":54,"value":108},"WordPress Coding Standards are much more than just a code style: they are also about ensuring ",{"type":43,"tag":57,"props":110,"children":112},{"href":111},"#how-to-improve-system-performance-with-wordpress-coding-standards",[113],{"type":54,"value":78},{"type":54,"value":115},", ",{"type":43,"tag":57,"props":117,"children":119},{"href":118},"#how-to-improve-system-security-with-wordpress-coding-standards",[120],{"type":54,"value":121},"security",{"type":54,"value":123},", and ",{"type":43,"tag":57,"props":125,"children":127},{"href":126},"#how-to-improve-system-compatibility-with-wordpress-coding-standards",[128],{"type":54,"value":129},"system compatibility",{"type":54,"value":131},". That’s what I want to highlight today.",{"type":43,"tag":133,"props":134,"children":135},"cta",{},[],{"type":43,"tag":137,"props":138,"children":139},"hr",{},[],{"type":43,"tag":141,"props":142,"children":144},"h2",{"id":143},"how-to-improve-system-performance-with-wordpress-coding-standards",[145],{"type":54,"value":146},"How to Improve System Performance With WordPress Coding Standards?",{"type":43,"tag":50,"props":148,"children":149},{},[150,152,165],{"type":54,"value":151},"What's the easiest way to break WordPress with huge traffic? ",{"type":43,"tag":85,"props":153,"children":154},{},[155,157,163],{"type":54,"value":156},"Performing a ",{"type":43,"tag":37,"props":158,"children":160},{"className":159},[],[161],{"type":54,"value":162},"WP_Query",{"type":54,"value":164}," fetching a huge number of posts with meta query.",{"type":54,"value":166}," This is a common issue made by WordPress developers that can affects the system. It's easy to make such shortcuts when „we only have 10 posts - however, when the system grows, these queries can became hard to handle.",{"type":43,"tag":168,"props":169,"children":182},"pre",{"className":170,"code":171,"highlights":172,"language":181,"meta":7,"style":7},"language-php shiki shiki-themes one-dark-pro","function get(): array\n{\n    return get_posts(\n        [\n            'post_type' => 'post',\n            'posts_per_page' => 200,\n            'meta_query' => [\n                [\n                    'key' => 'color',\n                    'compare' => '=',\n                    'value' => 'red',\n                ],\n            ],\n        ]\n    );\n}\n",[173,174,175,176,177,178,179,180],6,7,8,9,10,11,12,13,"php",[183],{"type":43,"tag":37,"props":184,"children":185},{"__ignoreMap":7},[186,216,225,244,253,278,302,320,329,351,373,395,404,413,422,431],{"type":43,"tag":187,"props":188,"children":191},"span",{"class":189,"line":190},"line",1,[192,198,204,210],{"type":43,"tag":187,"props":193,"children":195},{"style":194},"--shiki-default:#C678DD",[196],{"type":54,"value":197},"function",{"type":43,"tag":187,"props":199,"children":201},{"style":200},"--shiki-default:#61AFEF",[202],{"type":54,"value":203}," get",{"type":43,"tag":187,"props":205,"children":207},{"style":206},"--shiki-default:#ABB2BF",[208],{"type":54,"value":209},"(): ",{"type":43,"tag":187,"props":211,"children":213},{"style":212},"--shiki-default:#E5C07B",[214],{"type":54,"value":215},"array\n",{"type":43,"tag":187,"props":217,"children":219},{"class":189,"line":218},2,[220],{"type":43,"tag":187,"props":221,"children":222},{"style":206},[223],{"type":54,"value":224},"{\n",{"type":43,"tag":187,"props":226,"children":228},{"class":189,"line":227},3,[229,234,239],{"type":43,"tag":187,"props":230,"children":231},{"style":194},[232],{"type":54,"value":233},"    return",{"type":43,"tag":187,"props":235,"children":236},{"style":200},[237],{"type":54,"value":238}," get_posts",{"type":43,"tag":187,"props":240,"children":241},{"style":206},[242],{"type":54,"value":243},"(\n",{"type":43,"tag":187,"props":245,"children":247},{"class":189,"line":246},4,[248],{"type":43,"tag":187,"props":249,"children":250},{"style":206},[251],{"type":54,"value":252},"        [\n",{"type":43,"tag":187,"props":254,"children":256},{"class":189,"line":255},5,[257,263,268,273],{"type":43,"tag":187,"props":258,"children":260},{"style":259},"--shiki-default:#98C379",[261],{"type":54,"value":262},"            'post_type'",{"type":43,"tag":187,"props":264,"children":265},{"style":206},[266],{"type":54,"value":267}," =>",{"type":43,"tag":187,"props":269,"children":270},{"style":259},[271],{"type":54,"value":272}," 'post'",{"type":43,"tag":187,"props":274,"children":275},{"style":206},[276],{"type":54,"value":277},",\n",{"type":43,"tag":187,"props":279,"children":282},{"class":280,"line":173},[189,281],"highlight",[283,288,292,298],{"type":43,"tag":187,"props":284,"children":285},{"style":259},[286],{"type":54,"value":287},"            'posts_per_page'",{"type":43,"tag":187,"props":289,"children":290},{"style":206},[291],{"type":54,"value":267},{"type":43,"tag":187,"props":293,"children":295},{"style":294},"--shiki-default:#D19A66",[296],{"type":54,"value":297}," 200",{"type":43,"tag":187,"props":299,"children":300},{"style":206},[301],{"type":54,"value":277},{"type":43,"tag":187,"props":303,"children":305},{"class":304,"line":174},[189,281],[306,311,315],{"type":43,"tag":187,"props":307,"children":308},{"style":259},[309],{"type":54,"value":310},"            'meta_query'",{"type":43,"tag":187,"props":312,"children":313},{"style":206},[314],{"type":54,"value":267},{"type":43,"tag":187,"props":316,"children":317},{"style":206},[318],{"type":54,"value":319}," [\n",{"type":43,"tag":187,"props":321,"children":323},{"class":322,"line":175},[189,281],[324],{"type":43,"tag":187,"props":325,"children":326},{"style":206},[327],{"type":54,"value":328},"                [\n",{"type":43,"tag":187,"props":330,"children":332},{"class":331,"line":176},[189,281],[333,338,342,347],{"type":43,"tag":187,"props":334,"children":335},{"style":259},[336],{"type":54,"value":337},"                    'key'",{"type":43,"tag":187,"props":339,"children":340},{"style":206},[341],{"type":54,"value":267},{"type":43,"tag":187,"props":343,"children":344},{"style":259},[345],{"type":54,"value":346}," 'color'",{"type":43,"tag":187,"props":348,"children":349},{"style":206},[350],{"type":54,"value":277},{"type":43,"tag":187,"props":352,"children":354},{"class":353,"line":177},[189,281],[355,360,364,369],{"type":43,"tag":187,"props":356,"children":357},{"style":259},[358],{"type":54,"value":359},"                    'compare'",{"type":43,"tag":187,"props":361,"children":362},{"style":206},[363],{"type":54,"value":267},{"type":43,"tag":187,"props":365,"children":366},{"style":259},[367],{"type":54,"value":368}," '='",{"type":43,"tag":187,"props":370,"children":371},{"style":206},[372],{"type":54,"value":277},{"type":43,"tag":187,"props":374,"children":376},{"class":375,"line":178},[189,281],[377,382,386,391],{"type":43,"tag":187,"props":378,"children":379},{"style":259},[380],{"type":54,"value":381},"                    'value'",{"type":43,"tag":187,"props":383,"children":384},{"style":206},[385],{"type":54,"value":267},{"type":43,"tag":187,"props":387,"children":388},{"style":259},[389],{"type":54,"value":390}," 'red'",{"type":43,"tag":187,"props":392,"children":393},{"style":206},[394],{"type":54,"value":277},{"type":43,"tag":187,"props":396,"children":398},{"class":397,"line":179},[189,281],[399],{"type":43,"tag":187,"props":400,"children":401},{"style":206},[402],{"type":54,"value":403},"                ],\n",{"type":43,"tag":187,"props":405,"children":407},{"class":406,"line":180},[189,281],[408],{"type":43,"tag":187,"props":409,"children":410},{"style":206},[411],{"type":54,"value":412},"            ],\n",{"type":43,"tag":187,"props":414,"children":416},{"class":189,"line":415},14,[417],{"type":43,"tag":187,"props":418,"children":419},{"style":206},[420],{"type":54,"value":421},"        ]\n",{"type":43,"tag":187,"props":423,"children":425},{"class":189,"line":424},15,[426],{"type":43,"tag":187,"props":427,"children":428},{"style":206},[429],{"type":54,"value":430},"    );\n",{"type":43,"tag":187,"props":432,"children":434},{"class":189,"line":433},16,[435],{"type":43,"tag":187,"props":436,"children":437},{"style":206},[438],{"type":54,"value":439},"}\n",{"type":43,"tag":50,"props":441,"children":442},{},[443,445],{"type":54,"value":444},"How do WordPress Coding Standards help here? ",{"type":43,"tag":85,"props":446,"children":447},{},[448,450,456,458,464],{"type":54,"value":449},"WordPress Coding Standards mark the usage of huge ",{"type":43,"tag":37,"props":451,"children":453},{"className":452},[],[454],{"type":54,"value":455},"posts_per_page",{"type":54,"value":457}," argument or usage of ",{"type":43,"tag":37,"props":459,"children":461},{"className":460},[],[462],{"type":54,"value":463},"meta_query",{"type":54,"value":465}," arguments as WARNING immediately indicating the part of the code that requires special attention.",{"type":43,"tag":467,"props":468,"children":470},"prose-gallery",{":items":469},"[\"https://cdn.pragmate.dev/wp-content/uploads/2025/02/66ef5aed-37e5-4fb8-b206-d860985272c1.png\",\"https://cdn.pragmate.dev/wp-content/uploads/2025/02/12ae273b-7c03-4fb1-ac0b-925d192cac53.png\"]",[],{"type":43,"tag":50,"props":472,"children":473},{},[474,476,481],{"type":54,"value":475},"You might argue that it's just a warning, but our team follows a strict 'no error, no warning' policy. ",{"type":43,"tag":85,"props":477,"children":478},{},[479],{"type":54,"value":480},"If the code generates a warning, it's a clear sign that something isn’t right.",{"type":54,"value":482}," Any such issue must have a valid justification; otherwise, the code won’t be accepted in the PR.",{"type":43,"tag":50,"props":484,"children":485},{},[486,488,493],{"type":54,"value":487},"In this case, we can use other, more effective pagination methods, modify the query to return a manageable number of elements, or reevaluate our business requirements. There are ",{"type":43,"tag":57,"props":489,"children":490},{"href":75},[491],{"type":54,"value":492},"many alternatives",{"type":54,"value":494}," to using this kind of shortcut so it's good to know them.",{"type":43,"tag":137,"props":496,"children":497},{},[],{"type":43,"tag":141,"props":499,"children":501},{"id":500},"how-to-improve-system-security-with-wordpress-coding-standards",[502],{"type":54,"value":503},"How to Improve System Security With WordPress Coding Standards?",{"type":43,"tag":50,"props":505,"children":506},{},[507,509,520,522,527],{"type":54,"value":508},"What comes to mind first when considering WordPress security and a form that processes user input? ",{"type":43,"tag":85,"props":510,"children":511},{},[512],{"type":43,"tag":57,"props":513,"children":517},{"href":514,"rel":515},"https://developer.wordpress.org/apis/security/sanitizing/",[516],"nofollow",[518],{"type":54,"value":519},"Data sanitization",{"type":54,"value":521}," should be at the top of your list. It's a critical step that's often overlooked, especially by those just starting with WordPress. ",{"type":43,"tag":85,"props":523,"children":524},{},[525],{"type":54,"value":526},"Every piece of data that is taken from the user should be filtered and cleaned to prevent security issues",{"type":54,"value":528}," ⚠️",{"type":43,"tag":168,"props":530,"children":533},{"className":170,"code":531,"highlights":532,"language":181,"meta":7,"style":7},"add_action('wp_ajax_fm_ajax_handler', function() {\n    wp_send_json_success(\n        handle([\n            'after' => ! empty($_POST['after']) ? $_POST['after'] : 0,\n        ])\n    );\n})\n",[246],[534],{"type":43,"tag":37,"props":535,"children":536},{"__ignoreMap":7},[537,575,587,600,686,694,701],{"type":43,"tag":187,"props":538,"children":539},{"class":189,"line":190},[540,545,550,555,560,565,570],{"type":43,"tag":187,"props":541,"children":542},{"style":200},[543],{"type":54,"value":544},"add_action",{"type":43,"tag":187,"props":546,"children":547},{"style":206},[548],{"type":54,"value":549},"(",{"type":43,"tag":187,"props":551,"children":552},{"style":259},[553],{"type":54,"value":554},"'wp_ajax_fm_ajax_handler'",{"type":43,"tag":187,"props":556,"children":557},{"style":206},[558],{"type":54,"value":559},",",{"type":43,"tag":187,"props":561,"children":562},{"style":194},[563],{"type":54,"value":564}," function",{"type":43,"tag":187,"props":566,"children":567},{"style":206},[568],{"type":54,"value":569},"()",{"type":43,"tag":187,"props":571,"children":572},{"style":206},[573],{"type":54,"value":574}," {\n",{"type":43,"tag":187,"props":576,"children":577},{"class":189,"line":218},[578,583],{"type":43,"tag":187,"props":579,"children":580},{"style":200},[581],{"type":54,"value":582},"    wp_send_json_success",{"type":43,"tag":187,"props":584,"children":585},{"style":206},[586],{"type":54,"value":243},{"type":43,"tag":187,"props":588,"children":589},{"class":189,"line":227},[590,595],{"type":43,"tag":187,"props":591,"children":592},{"style":200},[593],{"type":54,"value":594},"        handle",{"type":43,"tag":187,"props":596,"children":597},{"style":206},[598],{"type":54,"value":599},"([\n",{"type":43,"tag":187,"props":601,"children":603},{"class":602,"line":246},[189,281],[604,609,613,619,624,628,634,639,644,649,654,659,663,667,672,677,682],{"type":43,"tag":187,"props":605,"children":606},{"style":259},[607],{"type":54,"value":608},"            'after'",{"type":43,"tag":187,"props":610,"children":611},{"style":206},[612],{"type":54,"value":267},{"type":43,"tag":187,"props":614,"children":616},{"style":615},"--shiki-default:#56B6C2",[617],{"type":54,"value":618}," !",{"type":43,"tag":187,"props":620,"children":621},{"style":615},[622],{"type":54,"value":623}," empty",{"type":43,"tag":187,"props":625,"children":626},{"style":206},[627],{"type":54,"value":549},{"type":43,"tag":187,"props":629,"children":631},{"style":630},"--shiki-default:#E06C75",[632],{"type":54,"value":633},"$_POST",{"type":43,"tag":187,"props":635,"children":636},{"style":206},[637],{"type":54,"value":638},"[",{"type":43,"tag":187,"props":640,"children":641},{"style":259},[642],{"type":54,"value":643},"'after'",{"type":43,"tag":187,"props":645,"children":646},{"style":206},[647],{"type":54,"value":648},"])",{"type":43,"tag":187,"props":650,"children":651},{"style":194},[652],{"type":54,"value":653}," ?",{"type":43,"tag":187,"props":655,"children":656},{"style":630},[657],{"type":54,"value":658}," $_POST",{"type":43,"tag":187,"props":660,"children":661},{"style":206},[662],{"type":54,"value":638},{"type":43,"tag":187,"props":664,"children":665},{"style":259},[666],{"type":54,"value":643},{"type":43,"tag":187,"props":668,"children":669},{"style":206},[670],{"type":54,"value":671},"]",{"type":43,"tag":187,"props":673,"children":674},{"style":194},[675],{"type":54,"value":676}," :",{"type":43,"tag":187,"props":678,"children":679},{"style":294},[680],{"type":54,"value":681}," 0",{"type":43,"tag":187,"props":683,"children":684},{"style":206},[685],{"type":54,"value":277},{"type":43,"tag":187,"props":687,"children":688},{"class":189,"line":255},[689],{"type":43,"tag":187,"props":690,"children":691},{"style":206},[692],{"type":54,"value":693},"        ])\n",{"type":43,"tag":187,"props":695,"children":696},{"class":189,"line":173},[697],{"type":43,"tag":187,"props":698,"children":699},{"style":206},[700],{"type":54,"value":430},{"type":43,"tag":187,"props":702,"children":703},{"class":189,"line":174},[704],{"type":43,"tag":187,"props":705,"children":706},{"style":206},[707],{"type":54,"value":708},"})\n",{"type":43,"tag":50,"props":710,"children":711},{},[712,714,720,722,727],{"type":54,"value":713},"Let's assume that the handle function involves making database queries and requires the ",{"type":43,"tag":37,"props":715,"children":717},{"className":716},[],[718],{"type":54,"value":719},"after",{"type":54,"value":721}," value to be a number. Simply assuming that users will input a number when they see a field with a number type in a form will lead to security risks. ",{"type":43,"tag":85,"props":723,"children":724},{},[725],{"type":54,"value":726},"It's crucial to assume that users might attempt to enter various other inputs, such as an SQL query that could potentially expose your data.",{"type":54,"value":728}," How do WordPress Coding Standards help preventing security breaches?",{"type":43,"tag":467,"props":730,"children":732},{":items":731},"[\"https://cdn.pragmate.dev/wp-content/uploads/2025/02/4505c56c-992e-4917-8d19-6f958ff23c0e.png\",\"https://cdn.pragmate.dev/wp-content/uploads/2025/02/214f0726-b446-43a7-8b4f-f9ff6eba01b8.png\",\"https://cdn.pragmate.dev/wp-content/uploads/2025/02/9f0e884a-3f2f-4610-ab0d-9d28e3adddc8.png\"]",[],{"type":43,"tag":50,"props":734,"children":735},{},[736,741],{"type":43,"tag":85,"props":737,"children":738},{},[739],{"type":54,"value":740},"When data is collected from users, it is flagged as an error if it's not cleaned.",{"type":54,"value":742}," While there might be rare cases where data doesn't need sanitization, these are extremely uncommon. In nearly all scenarios, developers should pause and ensure appropriate data sanitization is in place to maintain security and functionality. In this case, we can just cast a value.",{"type":43,"tag":168,"props":744,"children":747},{"className":170,"code":745,"highlights":746,"language":181,"meta":7,"style":7},"add_action('wp_ajax_fm_ajax_handler', function() {\n    $nonce = ! empty($_POST['nonce']) ? sanitize_key($_POST['nonce']) : '';\n\n    if (! wp_verify_nonce($nonce, 'nonce')) {\n        wp_send_json_error();\n    }\n\n    wp_send_json_success(\n        handle([\n            'after' => ! empty($_POST['after']) ? (int) $_POST['after'] : 0,\n        ])\n    );\n})\n",[177],[748],{"type":43,"tag":37,"props":749,"children":750},{"__ignoreMap":7},[751,782,867,875,925,938,946,953,964,975,1061,1068,1075],{"type":43,"tag":187,"props":752,"children":753},{"class":189,"line":190},[754,758,762,766,770,774,778],{"type":43,"tag":187,"props":755,"children":756},{"style":200},[757],{"type":54,"value":544},{"type":43,"tag":187,"props":759,"children":760},{"style":206},[761],{"type":54,"value":549},{"type":43,"tag":187,"props":763,"children":764},{"style":259},[765],{"type":54,"value":554},{"type":43,"tag":187,"props":767,"children":768},{"style":206},[769],{"type":54,"value":559},{"type":43,"tag":187,"props":771,"children":772},{"style":194},[773],{"type":54,"value":564},{"type":43,"tag":187,"props":775,"children":776},{"style":206},[777],{"type":54,"value":569},{"type":43,"tag":187,"props":779,"children":780},{"style":206},[781],{"type":54,"value":574},{"type":43,"tag":187,"props":783,"children":784},{"class":189,"line":218},[785,790,795,799,803,807,811,815,820,824,828,833,837,841,845,849,853,857,862],{"type":43,"tag":187,"props":786,"children":787},{"style":630},[788],{"type":54,"value":789},"    $nonce",{"type":43,"tag":187,"props":791,"children":792},{"style":615},[793],{"type":54,"value":794}," =",{"type":43,"tag":187,"props":796,"children":797},{"style":615},[798],{"type":54,"value":618},{"type":43,"tag":187,"props":800,"children":801},{"style":615},[802],{"type":54,"value":623},{"type":43,"tag":187,"props":804,"children":805},{"style":206},[806],{"type":54,"value":549},{"type":43,"tag":187,"props":808,"children":809},{"style":630},[810],{"type":54,"value":633},{"type":43,"tag":187,"props":812,"children":813},{"style":206},[814],{"type":54,"value":638},{"type":43,"tag":187,"props":816,"children":817},{"style":259},[818],{"type":54,"value":819},"'nonce'",{"type":43,"tag":187,"props":821,"children":822},{"style":206},[823],{"type":54,"value":648},{"type":43,"tag":187,"props":825,"children":826},{"style":194},[827],{"type":54,"value":653},{"type":43,"tag":187,"props":829,"children":830},{"style":200},[831],{"type":54,"value":832}," sanitize_key",{"type":43,"tag":187,"props":834,"children":835},{"style":206},[836],{"type":54,"value":549},{"type":43,"tag":187,"props":838,"children":839},{"style":630},[840],{"type":54,"value":633},{"type":43,"tag":187,"props":842,"children":843},{"style":206},[844],{"type":54,"value":638},{"type":43,"tag":187,"props":846,"children":847},{"style":259},[848],{"type":54,"value":819},{"type":43,"tag":187,"props":850,"children":851},{"style":206},[852],{"type":54,"value":648},{"type":43,"tag":187,"props":854,"children":855},{"style":194},[856],{"type":54,"value":676},{"type":43,"tag":187,"props":858,"children":859},{"style":259},[860],{"type":54,"value":861}," ''",{"type":43,"tag":187,"props":863,"children":864},{"style":206},[865],{"type":54,"value":866},";\n",{"type":43,"tag":187,"props":868,"children":869},{"class":189,"line":227},[870],{"type":43,"tag":187,"props":871,"children":872},{"emptyLinePlaceholder":38},[873],{"type":54,"value":874},"\n",{"type":43,"tag":187,"props":876,"children":877},{"class":189,"line":246},[878,883,888,893,898,902,907,911,916,921],{"type":43,"tag":187,"props":879,"children":880},{"style":194},[881],{"type":54,"value":882},"    if",{"type":43,"tag":187,"props":884,"children":885},{"style":206},[886],{"type":54,"value":887}," (",{"type":43,"tag":187,"props":889,"children":890},{"style":615},[891],{"type":54,"value":892},"!",{"type":43,"tag":187,"props":894,"children":895},{"style":200},[896],{"type":54,"value":897}," wp_verify_nonce",{"type":43,"tag":187,"props":899,"children":900},{"style":206},[901],{"type":54,"value":549},{"type":43,"tag":187,"props":903,"children":904},{"style":630},[905],{"type":54,"value":906},"$nonce",{"type":43,"tag":187,"props":908,"children":909},{"style":206},[910],{"type":54,"value":559},{"type":43,"tag":187,"props":912,"children":913},{"style":259},[914],{"type":54,"value":915}," 'nonce'",{"type":43,"tag":187,"props":917,"children":918},{"style":206},[919],{"type":54,"value":920},"))",{"type":43,"tag":187,"props":922,"children":923},{"style":206},[924],{"type":54,"value":574},{"type":43,"tag":187,"props":926,"children":927},{"class":189,"line":255},[928,933],{"type":43,"tag":187,"props":929,"children":930},{"style":200},[931],{"type":54,"value":932},"        wp_send_json_error",{"type":43,"tag":187,"props":934,"children":935},{"style":206},[936],{"type":54,"value":937},"();\n",{"type":43,"tag":187,"props":939,"children":940},{"class":189,"line":173},[941],{"type":43,"tag":187,"props":942,"children":943},{"style":206},[944],{"type":54,"value":945},"    }\n",{"type":43,"tag":187,"props":947,"children":948},{"class":189,"line":174},[949],{"type":43,"tag":187,"props":950,"children":951},{"emptyLinePlaceholder":38},[952],{"type":54,"value":874},{"type":43,"tag":187,"props":954,"children":955},{"class":189,"line":175},[956,960],{"type":43,"tag":187,"props":957,"children":958},{"style":200},[959],{"type":54,"value":582},{"type":43,"tag":187,"props":961,"children":962},{"style":206},[963],{"type":54,"value":243},{"type":43,"tag":187,"props":965,"children":966},{"class":189,"line":176},[967,971],{"type":43,"tag":187,"props":968,"children":969},{"style":200},[970],{"type":54,"value":594},{"type":43,"tag":187,"props":972,"children":973},{"style":206},[974],{"type":54,"value":599},{"type":43,"tag":187,"props":976,"children":978},{"class":977,"line":177},[189,281],[979,983,987,991,995,999,1003,1007,1011,1015,1019,1023,1028,1033,1037,1041,1045,1049,1053,1057],{"type":43,"tag":187,"props":980,"children":981},{"style":259},[982],{"type":54,"value":608},{"type":43,"tag":187,"props":984,"children":985},{"style":206},[986],{"type":54,"value":267},{"type":43,"tag":187,"props":988,"children":989},{"style":615},[990],{"type":54,"value":618},{"type":43,"tag":187,"props":992,"children":993},{"style":615},[994],{"type":54,"value":623},{"type":43,"tag":187,"props":996,"children":997},{"style":206},[998],{"type":54,"value":549},{"type":43,"tag":187,"props":1000,"children":1001},{"style":630},[1002],{"type":54,"value":633},{"type":43,"tag":187,"props":1004,"children":1005},{"style":206},[1006],{"type":54,"value":638},{"type":43,"tag":187,"props":1008,"children":1009},{"style":259},[1010],{"type":54,"value":643},{"type":43,"tag":187,"props":1012,"children":1013},{"style":206},[1014],{"type":54,"value":648},{"type":43,"tag":187,"props":1016,"children":1017},{"style":194},[1018],{"type":54,"value":653},{"type":43,"tag":187,"props":1020,"children":1021},{"style":206},[1022],{"type":54,"value":887},{"type":43,"tag":187,"props":1024,"children":1025},{"style":212},[1026],{"type":54,"value":1027},"int",{"type":43,"tag":187,"props":1029,"children":1030},{"style":206},[1031],{"type":54,"value":1032},")",{"type":43,"tag":187,"props":1034,"children":1035},{"style":630},[1036],{"type":54,"value":658},{"type":43,"tag":187,"props":1038,"children":1039},{"style":206},[1040],{"type":54,"value":638},{"type":43,"tag":187,"props":1042,"children":1043},{"style":259},[1044],{"type":54,"value":643},{"type":43,"tag":187,"props":1046,"children":1047},{"style":206},[1048],{"type":54,"value":671},{"type":43,"tag":187,"props":1050,"children":1051},{"style":194},[1052],{"type":54,"value":676},{"type":43,"tag":187,"props":1054,"children":1055},{"style":294},[1056],{"type":54,"value":681},{"type":43,"tag":187,"props":1058,"children":1059},{"style":206},[1060],{"type":54,"value":277},{"type":43,"tag":187,"props":1062,"children":1063},{"class":189,"line":178},[1064],{"type":43,"tag":187,"props":1065,"children":1066},{"style":206},[1067],{"type":54,"value":693},{"type":43,"tag":187,"props":1069,"children":1070},{"class":189,"line":179},[1071],{"type":43,"tag":187,"props":1072,"children":1073},{"style":206},[1074],{"type":54,"value":430},{"type":43,"tag":187,"props":1076,"children":1077},{"class":189,"line":180},[1078],{"type":43,"tag":187,"props":1079,"children":1080},{"style":206},[1081],{"type":54,"value":708},{"type":43,"tag":137,"props":1083,"children":1084},{},[],{"type":43,"tag":141,"props":1086,"children":1088},{"id":1087},"how-to-improve-system-compatibility-with-wordpress-coding-standards",[1089],{"type":54,"value":1090},"How to Improve System Compatibility With WordPress Coding Standards?",{"type":43,"tag":50,"props":1092,"children":1093},{},[1094,1096,1102],{"type":54,"value":1095},"WordPress developers often rely on knowledge shared by the community, but keeping up with all the new recommendations can be challenging and time consuming. To illustrate this, consider an example of function that removes file from the server with ",{"type":43,"tag":37,"props":1097,"children":1099},{"className":1098},[],[1100],{"type":54,"value":1101},"unlink",{"type":54,"value":1103}," method.",{"type":43,"tag":168,"props":1105,"children":1108},{"className":170,"code":1106,"highlights":1107,"language":181,"meta":7,"style":7},"function delete(string $path): void\n{\n    if (current_user_can('manage_options')) {\n        unlink($path);\n    }\n}\n",[246],[1109],{"type":43,"tag":37,"props":1110,"children":1111},{"__ignoreMap":7},[1112,1148,1155,1185,1208,1215],{"type":43,"tag":187,"props":1113,"children":1114},{"class":189,"line":190},[1115,1119,1124,1128,1133,1138,1143],{"type":43,"tag":187,"props":1116,"children":1117},{"style":194},[1118],{"type":54,"value":197},{"type":43,"tag":187,"props":1120,"children":1121},{"style":200},[1122],{"type":54,"value":1123}," delete",{"type":43,"tag":187,"props":1125,"children":1126},{"style":206},[1127],{"type":54,"value":549},{"type":43,"tag":187,"props":1129,"children":1130},{"style":212},[1131],{"type":54,"value":1132},"string",{"type":43,"tag":187,"props":1134,"children":1135},{"style":630},[1136],{"type":54,"value":1137}," $path",{"type":43,"tag":187,"props":1139,"children":1140},{"style":206},[1141],{"type":54,"value":1142},"): ",{"type":43,"tag":187,"props":1144,"children":1145},{"style":212},[1146],{"type":54,"value":1147},"void\n",{"type":43,"tag":187,"props":1149,"children":1150},{"class":189,"line":218},[1151],{"type":43,"tag":187,"props":1152,"children":1153},{"style":206},[1154],{"type":54,"value":224},{"type":43,"tag":187,"props":1156,"children":1157},{"class":189,"line":227},[1158,1162,1166,1171,1175,1180],{"type":43,"tag":187,"props":1159,"children":1160},{"style":194},[1161],{"type":54,"value":882},{"type":43,"tag":187,"props":1163,"children":1164},{"style":206},[1165],{"type":54,"value":887},{"type":43,"tag":187,"props":1167,"children":1168},{"style":200},[1169],{"type":54,"value":1170},"current_user_can",{"type":43,"tag":187,"props":1172,"children":1173},{"style":206},[1174],{"type":54,"value":549},{"type":43,"tag":187,"props":1176,"children":1177},{"style":259},[1178],{"type":54,"value":1179},"'manage_options'",{"type":43,"tag":187,"props":1181,"children":1182},{"style":206},[1183],{"type":54,"value":1184},")) {\n",{"type":43,"tag":187,"props":1186,"children":1188},{"class":1187,"line":246},[189,281],[1189,1194,1198,1203],{"type":43,"tag":187,"props":1190,"children":1191},{"style":615},[1192],{"type":54,"value":1193},"        unlink",{"type":43,"tag":187,"props":1195,"children":1196},{"style":206},[1197],{"type":54,"value":549},{"type":43,"tag":187,"props":1199,"children":1200},{"style":630},[1201],{"type":54,"value":1202},"$path",{"type":43,"tag":187,"props":1204,"children":1205},{"style":206},[1206],{"type":54,"value":1207},");\n",{"type":43,"tag":187,"props":1209,"children":1210},{"class":189,"line":255},[1211],{"type":43,"tag":187,"props":1212,"children":1213},{"style":206},[1214],{"type":54,"value":945},{"type":43,"tag":187,"props":1216,"children":1217},{"class":189,"line":173},[1218],{"type":43,"tag":187,"props":1219,"children":1220},{"style":206},[1221],{"type":54,"value":439},{"type":43,"tag":50,"props":1223,"children":1224},{},[1225,1227,1240],{"type":54,"value":1226},"To standardize file management in the codebase and give developers more control over this aspect, ",{"type":43,"tag":85,"props":1228,"children":1229},{},[1230,1232,1238],{"type":54,"value":1231},"WordPress core suggests using ",{"type":43,"tag":37,"props":1233,"children":1235},{"className":1234},[],[1236],{"type":54,"value":1237},"wp_delete_file",{"type":54,"value":1239}," instead",{"type":54,"value":1241},".",{"type":43,"tag":467,"props":1243,"children":1245},{":items":1244},"[\"https://cdn.pragmate.dev/wp-content/uploads/2025/02/53e868ab-820c-419a-97c5-7e3333612cb9.png\",\"https://cdn.pragmate.dev/wp-content/uploads/2025/02/9a3ec7eb-3dc9-46b4-be7a-c55a1468f169.png\"]",[],{"type":43,"tag":50,"props":1247,"children":1248},{},[1249,1251,1256,1258,1263],{"type":54,"value":1250},"It's sometimes hard to keep track of the recommendations like this, however the ",{"type":43,"tag":85,"props":1252,"children":1253},{},[1254],{"type":54,"value":1255},"WordPress Coding Standard can track them for us",{"type":54,"value":1257},". WordPress Coding Standards helps by flagging specific solutions as deprecated or not recommended and suggests different ones, ",{"type":43,"tag":85,"props":1259,"children":1260},{},[1261],{"type":54,"value":1262},"letting the developers create a code that is more compatible with the official WordPress rules",{"type":54,"value":1241},{"type":43,"tag":168,"props":1265,"children":1268},{"className":170,"code":1266,"highlights":1267,"language":181,"meta":7,"style":7},"function delete(string $path): void\n{\n    if (current_user_can('manage_options')) {\n        wp_delete_file($path);\n    }\n}\n",[246],[1269],{"type":43,"tag":37,"props":1270,"children":1271},{"__ignoreMap":7},[1272,1303,1310,1337,1358,1365],{"type":43,"tag":187,"props":1273,"children":1274},{"class":189,"line":190},[1275,1279,1283,1287,1291,1295,1299],{"type":43,"tag":187,"props":1276,"children":1277},{"style":194},[1278],{"type":54,"value":197},{"type":43,"tag":187,"props":1280,"children":1281},{"style":200},[1282],{"type":54,"value":1123},{"type":43,"tag":187,"props":1284,"children":1285},{"style":206},[1286],{"type":54,"value":549},{"type":43,"tag":187,"props":1288,"children":1289},{"style":212},[1290],{"type":54,"value":1132},{"type":43,"tag":187,"props":1292,"children":1293},{"style":630},[1294],{"type":54,"value":1137},{"type":43,"tag":187,"props":1296,"children":1297},{"style":206},[1298],{"type":54,"value":1142},{"type":43,"tag":187,"props":1300,"children":1301},{"style":212},[1302],{"type":54,"value":1147},{"type":43,"tag":187,"props":1304,"children":1305},{"class":189,"line":218},[1306],{"type":43,"tag":187,"props":1307,"children":1308},{"style":206},[1309],{"type":54,"value":224},{"type":43,"tag":187,"props":1311,"children":1312},{"class":189,"line":227},[1313,1317,1321,1325,1329,1333],{"type":43,"tag":187,"props":1314,"children":1315},{"style":194},[1316],{"type":54,"value":882},{"type":43,"tag":187,"props":1318,"children":1319},{"style":206},[1320],{"type":54,"value":887},{"type":43,"tag":187,"props":1322,"children":1323},{"style":200},[1324],{"type":54,"value":1170},{"type":43,"tag":187,"props":1326,"children":1327},{"style":206},[1328],{"type":54,"value":549},{"type":43,"tag":187,"props":1330,"children":1331},{"style":259},[1332],{"type":54,"value":1179},{"type":43,"tag":187,"props":1334,"children":1335},{"style":206},[1336],{"type":54,"value":1184},{"type":43,"tag":187,"props":1338,"children":1340},{"class":1339,"line":246},[189,281],[1341,1346,1350,1354],{"type":43,"tag":187,"props":1342,"children":1343},{"style":200},[1344],{"type":54,"value":1345},"        wp_delete_file",{"type":43,"tag":187,"props":1347,"children":1348},{"style":206},[1349],{"type":54,"value":549},{"type":43,"tag":187,"props":1351,"children":1352},{"style":630},[1353],{"type":54,"value":1202},{"type":43,"tag":187,"props":1355,"children":1356},{"style":206},[1357],{"type":54,"value":1207},{"type":43,"tag":187,"props":1359,"children":1360},{"class":189,"line":255},[1361],{"type":43,"tag":187,"props":1362,"children":1363},{"style":206},[1364],{"type":54,"value":945},{"type":43,"tag":187,"props":1366,"children":1367},{"class":189,"line":173},[1368],{"type":43,"tag":187,"props":1369,"children":1370},{"style":206},[1371],{"type":54,"value":439},{"type":43,"tag":137,"props":1373,"children":1374},{},[],{"type":43,"tag":141,"props":1376,"children":1378},{"id":1377},"how-to-install-wordpress-coding-standards",[1379],{"type":54,"value":1380},"How to Install WordPress Coding Standards?",{"type":43,"tag":50,"props":1382,"children":1383},{},[1384,1386,1393,1395,1401,1403,1409],{"type":54,"value":1385},"If you plan to use ",{"type":43,"tag":57,"props":1387,"children":1390},{"href":1388,"rel":1389},"https://github.com/WordPress/WordPress-Coding-Standards",[516],[1391],{"type":54,"value":1392},"WordPress Coding Standards",{"type":54,"value":1394},", you need to install them first, since they are not available by default in ",{"type":43,"tag":57,"props":1396,"children":1398},{"href":1397},"/php/phpcs/",[1399],{"type":54,"value":1400},"PHP Code Sniffer",{"type":54,"value":1402},". You can do it with ",{"type":43,"tag":57,"props":1404,"children":1406},{"href":1405},"/php/composer/",[1407],{"type":54,"value":1408},"Composer",{"type":54,"value":1241},{"type":43,"tag":168,"props":1411,"children":1415},{"className":1412,"code":1413,"language":1414,"meta":7,"style":7},"language-bash shiki shiki-themes one-dark-pro","composer require wp-coding-standards/wpcs:\"^3.0\" --dev\n","bash",[1416],{"type":43,"tag":37,"props":1417,"children":1418},{"__ignoreMap":7},[1419],{"type":43,"tag":187,"props":1420,"children":1421},{"class":189,"line":190},[1422,1427,1432,1437],{"type":43,"tag":187,"props":1423,"children":1424},{"style":200},[1425],{"type":54,"value":1426},"composer",{"type":43,"tag":187,"props":1428,"children":1429},{"style":259},[1430],{"type":54,"value":1431}," require",{"type":43,"tag":187,"props":1433,"children":1434},{"style":259},[1435],{"type":54,"value":1436}," wp-coding-standards/wpcs:\"^3.0\"",{"type":43,"tag":187,"props":1438,"children":1439},{"style":294},[1440],{"type":54,"value":1441}," --dev\n",{"type":43,"tag":50,"props":1443,"children":1444},{},[1445,1447,1453,1455,1461,1463,1468],{"type":54,"value":1446},"Then in the ",{"type":43,"tag":37,"props":1448,"children":1450},{"className":1449},[],[1451],{"type":54,"value":1452},"phpcs.xml.dist",{"type":54,"value":1454}," configuration and change the standard from ",{"type":43,"tag":37,"props":1456,"children":1458},{"className":1457},[],[1459],{"type":54,"value":1460},"PSR12",{"type":54,"value":1462}," to ",{"type":43,"tag":37,"props":1464,"children":1466},{"className":1465},[],[1467],{"type":54,"value":33},{"type":54,"value":1241},{"type":43,"tag":168,"props":1470,"children":1475},{"className":1471,"code":1472,"filename":1452,"highlights":1473,"language":1474,"meta":7,"style":7},"language-xml shiki shiki-themes one-dark-pro","\u003C?xml version=\"1.0\"?>\n\n\u003Cruleset name=\"pragmatedev\">\n  \u003Carg name=\"colors\" />\n  \u003Carg value=\"s\" />\n\n  \u003Cfile>app\u003C/file>\n  \u003Cfile>functions.php\u003C/file>\n\n  \u003Crule ref=\"WordPress\" />\n\u003C/ruleset>\n",[177],"xml",[1476],{"type":43,"tag":37,"props":1477,"children":1478},{"__ignoreMap":7},[1479,1511,1518,1550,1581,1610,1617,1642,1666,1673,1704],{"type":43,"tag":187,"props":1480,"children":1481},{"class":189,"line":190},[1482,1487,1491,1496,1501,1506],{"type":43,"tag":187,"props":1483,"children":1484},{"style":206},[1485],{"type":54,"value":1486},"\u003C?",{"type":43,"tag":187,"props":1488,"children":1489},{"style":630},[1490],{"type":54,"value":1474},{"type":43,"tag":187,"props":1492,"children":1493},{"style":294},[1494],{"type":54,"value":1495}," version",{"type":43,"tag":187,"props":1497,"children":1498},{"style":206},[1499],{"type":54,"value":1500},"=",{"type":43,"tag":187,"props":1502,"children":1503},{"style":259},[1504],{"type":54,"value":1505},"\"1.0\"",{"type":43,"tag":187,"props":1507,"children":1508},{"style":206},[1509],{"type":54,"value":1510},"?>\n",{"type":43,"tag":187,"props":1512,"children":1513},{"class":189,"line":218},[1514],{"type":43,"tag":187,"props":1515,"children":1516},{"emptyLinePlaceholder":38},[1517],{"type":54,"value":874},{"type":43,"tag":187,"props":1519,"children":1520},{"class":189,"line":227},[1521,1526,1531,1536,1540,1545],{"type":43,"tag":187,"props":1522,"children":1523},{"style":206},[1524],{"type":54,"value":1525},"\u003C",{"type":43,"tag":187,"props":1527,"children":1528},{"style":630},[1529],{"type":54,"value":1530},"ruleset",{"type":43,"tag":187,"props":1532,"children":1533},{"style":294},[1534],{"type":54,"value":1535}," name",{"type":43,"tag":187,"props":1537,"children":1538},{"style":206},[1539],{"type":54,"value":1500},{"type":43,"tag":187,"props":1541,"children":1542},{"style":259},[1543],{"type":54,"value":1544},"\"pragmatedev\"",{"type":43,"tag":187,"props":1546,"children":1547},{"style":206},[1548],{"type":54,"value":1549},">\n",{"type":43,"tag":187,"props":1551,"children":1552},{"class":189,"line":246},[1553,1558,1563,1567,1571,1576],{"type":43,"tag":187,"props":1554,"children":1555},{"style":206},[1556],{"type":54,"value":1557},"  \u003C",{"type":43,"tag":187,"props":1559,"children":1560},{"style":630},[1561],{"type":54,"value":1562},"arg",{"type":43,"tag":187,"props":1564,"children":1565},{"style":294},[1566],{"type":54,"value":1535},{"type":43,"tag":187,"props":1568,"children":1569},{"style":206},[1570],{"type":54,"value":1500},{"type":43,"tag":187,"props":1572,"children":1573},{"style":259},[1574],{"type":54,"value":1575},"\"colors\"",{"type":43,"tag":187,"props":1577,"children":1578},{"style":206},[1579],{"type":54,"value":1580}," />\n",{"type":43,"tag":187,"props":1582,"children":1583},{"class":189,"line":255},[1584,1588,1592,1597,1601,1606],{"type":43,"tag":187,"props":1585,"children":1586},{"style":206},[1587],{"type":54,"value":1557},{"type":43,"tag":187,"props":1589,"children":1590},{"style":630},[1591],{"type":54,"value":1562},{"type":43,"tag":187,"props":1593,"children":1594},{"style":294},[1595],{"type":54,"value":1596}," value",{"type":43,"tag":187,"props":1598,"children":1599},{"style":206},[1600],{"type":54,"value":1500},{"type":43,"tag":187,"props":1602,"children":1603},{"style":259},[1604],{"type":54,"value":1605},"\"s\"",{"type":43,"tag":187,"props":1607,"children":1608},{"style":206},[1609],{"type":54,"value":1580},{"type":43,"tag":187,"props":1611,"children":1612},{"class":189,"line":173},[1613],{"type":43,"tag":187,"props":1614,"children":1615},{"emptyLinePlaceholder":38},[1616],{"type":54,"value":874},{"type":43,"tag":187,"props":1618,"children":1619},{"class":189,"line":174},[1620,1624,1629,1634,1638],{"type":43,"tag":187,"props":1621,"children":1622},{"style":206},[1623],{"type":54,"value":1557},{"type":43,"tag":187,"props":1625,"children":1626},{"style":630},[1627],{"type":54,"value":1628},"file",{"type":43,"tag":187,"props":1630,"children":1631},{"style":206},[1632],{"type":54,"value":1633},">app\u003C/",{"type":43,"tag":187,"props":1635,"children":1636},{"style":630},[1637],{"type":54,"value":1628},{"type":43,"tag":187,"props":1639,"children":1640},{"style":206},[1641],{"type":54,"value":1549},{"type":43,"tag":187,"props":1643,"children":1644},{"class":189,"line":175},[1645,1649,1653,1658,1662],{"type":43,"tag":187,"props":1646,"children":1647},{"style":206},[1648],{"type":54,"value":1557},{"type":43,"tag":187,"props":1650,"children":1651},{"style":630},[1652],{"type":54,"value":1628},{"type":43,"tag":187,"props":1654,"children":1655},{"style":206},[1656],{"type":54,"value":1657},">functions.php\u003C/",{"type":43,"tag":187,"props":1659,"children":1660},{"style":630},[1661],{"type":54,"value":1628},{"type":43,"tag":187,"props":1663,"children":1664},{"style":206},[1665],{"type":54,"value":1549},{"type":43,"tag":187,"props":1667,"children":1668},{"class":189,"line":176},[1669],{"type":43,"tag":187,"props":1670,"children":1671},{"emptyLinePlaceholder":38},[1672],{"type":54,"value":874},{"type":43,"tag":187,"props":1674,"children":1676},{"class":1675,"line":177},[189,281],[1677,1681,1686,1691,1695,1700],{"type":43,"tag":187,"props":1678,"children":1679},{"style":206},[1680],{"type":54,"value":1557},{"type":43,"tag":187,"props":1682,"children":1683},{"style":630},[1684],{"type":54,"value":1685},"rule",{"type":43,"tag":187,"props":1687,"children":1688},{"style":294},[1689],{"type":54,"value":1690}," ref",{"type":43,"tag":187,"props":1692,"children":1693},{"style":206},[1694],{"type":54,"value":1500},{"type":43,"tag":187,"props":1696,"children":1697},{"style":259},[1698],{"type":54,"value":1699},"\"WordPress\"",{"type":43,"tag":187,"props":1701,"children":1702},{"style":206},[1703],{"type":54,"value":1580},{"type":43,"tag":187,"props":1705,"children":1706},{"class":189,"line":178},[1707,1712,1716],{"type":43,"tag":187,"props":1708,"children":1709},{"style":206},[1710],{"type":54,"value":1711},"\u003C/",{"type":43,"tag":187,"props":1713,"children":1714},{"style":630},[1715],{"type":54,"value":1530},{"type":43,"tag":187,"props":1717,"children":1718},{"style":206},[1719],{"type":54,"value":1549},{"type":43,"tag":137,"props":1721,"children":1722},{},[],{"type":43,"tag":50,"props":1724,"children":1725},{},[1726,1728,1733,1735,1740,1742,1748],{"type":54,"value":1727},"Those are just three examples of how WordPress Coding Standards can improve codebase, but they offer much more. For instance, ",{"type":43,"tag":85,"props":1729,"children":1730},{},[1731],{"type":54,"value":1732},"they can flag missing nonce verifications",{"type":54,"value":1734}," when processing user input in forms - something often overlooked, or also ",{"type":43,"tag":85,"props":1736,"children":1737},{},[1738],{"type":54,"value":1739},"warn against making direct database queries",{"type":54,"value":1741}," using the ",{"type":43,"tag":37,"props":1743,"children":1745},{"className":1744},[],[1746],{"type":54,"value":1747},"$wp_db",{"type":54,"value":1749}," object.",{"type":43,"tag":50,"props":1751,"children":1752},{},[1753,1766,1768,1773],{"type":43,"tag":85,"props":1754,"children":1755},{},[1756,1758,1765],{"type":54,"value":1757},"They for sure provide much more than what’s covered in the ",{"type":43,"tag":57,"props":1759,"children":1762},{"href":1760,"rel":1761},"https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/",[516],[1763],{"type":54,"value":1764},"official documentation",{"type":54,"value":1241},{"type":54,"value":1767}," In my opinion, the documentation mainly focuses on visual aspects - which is why I initially overlooked other important elements and ",{"type":43,"tag":57,"props":1769,"children":1770},{"href":36},[1771],{"type":54,"value":1772},"stated that I don't use them",{"type":54,"value":1241},{"type":43,"tag":50,"props":1775,"children":1776},{},[1777,1779,1784,1786,1792,1794,1801,1803,1809],{"type":54,"value":1778},"Luckily, that’s no longer the case. ",{"type":43,"tag":85,"props":1780,"children":1781},{},[1782],{"type":54,"value":1783},"Me, and my team now use WordPress Coding Standards with some tweaks",{"type":54,"value":1785}," - mainly for visual consistency since ",{"type":43,"tag":57,"props":1787,"children":1789},{"href":1788},"/wordpress/coding-style/#what-coding-styles-i-use-in-wordpress",[1790],{"type":54,"value":1791},"I still choose to use PSR12 as a coding style",{"type":54,"value":1793},". ",{"type":43,"tag":57,"props":1795,"children":1798},{"href":1796,"rel":1797},"https://github.com/pragmatedev/vilare/blob/master/phpcs.xml.dist",[516],[1799],{"type":54,"value":1800},"Here",{"type":54,"value":1802}," you can find my ",{"type":43,"tag":37,"props":1804,"children":1806},{"className":1805},[],[1807],{"type":54,"value":1808},"phpcs",{"type":54,"value":1810}," config which yo ucan use in your projects.",{"type":43,"tag":137,"props":1812,"children":1813},{},[],{"type":43,"tag":50,"props":1815,"children":1816},{},[1817],{"type":54,"value":1818},"What are your thoughts? Like me, did you initially think WordPress Coding Standards were only about visuals? What are the things that you were surprised about? Let me know in the comments and share your experience with others!",{"type":43,"tag":1820,"props":1821,"children":1822},"style",{},[1823],{"type":54,"value":1824},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":218,"depth":218,"links":1826},[1827,1828,1829,1830],{"id":143,"depth":218,"text":146},{"id":500,"depth":218,"text":503},{"id":1087,"depth":218,"text":1090},{"id":1377,"depth":218,"text":1380},"markdown","content:wordpress:coding-standards.md","content","wordpress/coding-standards.md","wordpress/coding-standards","md",1779792982100]