How to display the current and parent category in WordPress
Need to show the category hierarchy in your theme? Learn how to get the current category and its parent using get_the_category() and get_category_parents().
A PHP application delivered to an Italian public body can be accepted against a security reference that the supplier did not write: the AgID guidelines for secure software development. My name is Mariusz Szatkowski. I write custom PHP applications from Gdynia, remotely and in writing, and I either design the interface or build the one you bring. This page reads those guidelines for a Rome company that supplies PHP software to the public administration. It covers what the four annexes ask for, what the PHP chapter says, and where the 2020 text needs to be read against current PHP. I am not a lawyer, and the tender documents of each procedure decide what applies.

Rome from the Gianicolo. Photo: Krzysztof Golik, CC BY-SA 4.0, Wikimedia Commons.
The Agenzia per l’Italia Digitale (AgID), based at Via Liszt 21 in Rome, publishes the Linee guida per lo sviluppo del software sicuro in the CERT-AgID section of its site. The page says they belong to the ICT security guidelines for public administrations, whose purpose is to give measures for each component of the strategic model of the Piano Triennale, the three-year plan for IT in the public sector. The page was last updated on 6 May 2020 and lists four technical annexes, each dated 6 May 2020:
| Annex | Title (Italian) | Subject |
|---|---|---|
| 1 | Linee guida per l’adozione di un ciclo di sviluppo di software sicuro | secure development lifecycle |
| 2 | Linee guida per lo sviluppo sicuro di codice | secure coding, with chapters per language |
| 3 | Linee guida per la configurazione per adeguare la sicurezza del software di base | hardening of operating systems, web servers and other base software |
| 4 | Linee guida per la modellazione delle minacce e individuazione delle azioni di mitigazione conformi ai principi del Secure/Privacy by Design | threat modelling and mitigation |
An introduction, version 1.0 of 21 November 2017, frames the set.
The introduction states plainly that the document applies to the public administration. Suppliers come in through the section on the application strategy:
The same section says what the supplier of software, or the internal team, is then expected to do: address the security of the software according to the main industry standards described in the annexes, adopt best practice, fix vulnerabilities, keep to the contract terms for its staff and any subcontractors, protect information about known security problems and their documentation, and subject the source code to continuous security reviews throughout development, stating the standards, policies and practices it adopted.
The introduction names the people inside the administration who use the guidelines. One of them is the RUP, the official responsible for the tender procedure, who within a procurement procedure must require the supplier of each application to adopt specific standards for releasing secure software. AgID says it will monitor application through an annual questionnaire on the tools adopted and the results achieved.
For a Rome PHP supplier the guidelines show up as clauses in a capitolato, as acceptance criteria, or as a request to describe your secure development process in an offer. Reading the tender documents comes first; the annexes tell you what is behind the words.
Annex 1 sets out to guide a secure development process across all phases of the software development lifecycle. Its chapter on security in every phase walks through:
It surveys international initiatives (OWASP, Common Criteria, ISO, SAFECode, CERT Secure Coding, CWE, CAPEC and others) and maturity models such as SAMM and BSIMM. Its reference list starts with the GDPR, ISO/IEC 12207 on software lifecycle processes and the ENISA report on privacy by design. For a PHP project the annex does not prescribe a tool chain. It asks that each phase has a security activity and that someone can show it happened, which is the same evidence an acceptance check looks for.
Annex 2 is 156 pages of secure coding guidance, with general rules first and then chapters per language. Section 7.9 is the PHP chapter. It covers twelve vulnerability classes, each with how to recognise it, how to defend against it and an example:
| Section | Vulnerability | Countermeasure in the annex |
|---|---|---|
| 7.9.1 | Cross-site scripting | validate input against a whitelist, encode output by context, HTTPOnly session cookie, explicit charset |
| 7.9.2 | Code injection | no dynamic evaluation of input, a whitelist of allowed functions |
| 7.9.3 | Command injection | avoid shell calls, static strings, escapeshellarg() where a shell is unavoidable |
| 7.9.4 | File disclosure | a fixed list of readable files, or one folder and basename() on the user’s value |
| 7.9.5 | Remote file inclusion | never load libraries from user input, whitelist the names |
| 7.9.6 | File manipulation | restrict writes to one folder and sanitise file names |
| 7.9.7 | LDAP injection | whitelist validation of input used in LDAP filters |
| 7.9.8 | Reflected injection | avoid reflection driven by input, whitelist the callable names |
| 7.9.9 | SQL injection | parameterised queries with PDO prepared statements, least privilege |
| 7.9.10 | XPath injection | keep user data out of the query or encode it |
| 7.9.11 | XML external entities | disable DTD entity loading and validate XML against a strict schema |
| 7.9.12 | Unsafe deserialization | avoid unserialize() on external data, use JSON |
Most sections repeat the same instruction to validate all input, whatever its source, against a whitelist of type, size, range, format and expected values. The code, command and SQL injection sections add the principle of least privilege for the account the code runs under.
Some examples in section 7.9 were written for older PHP versions. A supplier who copies them into an offer or a code review checklist should read them against the PHP manual:
mysql_query(). php.net states that the extension was deprecated in PHP 5.5.0 and removed in PHP 7.0.0, with MySQLi or PDO_MySQL as replacements. The safe example in the annex already uses PDO prepared statements, which is the part to keep.libxml_disable_entity_loader(true). php.net marks the function deprecated as of PHP 8.0.0, with the note that external entity loading is disabled by default, and says relying on it is highly discouraged. On PHP 8 the risk lies in code that turns entity loading back on, so a review should search for options that do that.htmlspecialchars(), htmlentities(), strip_tags() and an add_slashes() function for JavaScript. PHP’s function is called addslashes(), and php.net describes it as escaping quotes, backslash and NUL for strings evaluated by PHP, and warns that it is sometimes wrongly used against SQL injection. It is not a JavaScript encoder. For htmlspecialchars(), php.net records that PHP 8.1.0 changed the default flags from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, so single quotes are now encoded by default.$HTTP_RAW_POST_DATA. The PHP 7.0 migration notes say it was removed and that php://input should be used instead. The advice itself stands: php.net warns not to pass untrusted user input to unserialize() regardless of the allowed_classes option.allow_url_include with a default of 0 and marks the directive deprecated as of PHP 7.4.0.The same examples, written for PHP 8:
<?php
// 7.9.9 SQL injection: PDO prepared statement, without mysql_query()
$stmt = $pdo->prepare('SELECT id, name FROM tabella WHERE name = :name');
$stmt->execute(['name' => $name]);
// 7.9.12 deserialization: php://input and JSON, no $HTTP_RAW_POST_DATA, no unserialize()
$params = json_decode(file_get_contents('php://input'), true, 512, JSON_THROW_ON_ERROR);
$user = new User((string) $params['name'], (string) $params['email']);
// 7.9.1 XSS: the flags PHP 8.1 and later use by default, written out
echo htmlspecialchars($name, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, 'UTF-8');JSON_THROW_ON_ERROR was added in PHP 7.3.0, according to the json_decode() changelog, so invalid JSON stops the request instead of returning null.
Annex 3 deals with base software: operating systems, browsers, workstations, web application servers, database servers, mail servers, service buses and office suites. Its Linux list includes hardening of the installed PHP, and its web platform section asks to remove response headers that reveal the server and to disable the HTTP TRACE method. On the PHP side, php.net documents expose_php, which adds the PHP version to the X-Powered-By header, has a default of 1 and can be changed in php.ini only; switching it off is the PHP part of that header rule.
Annex 4 covers secure and privacy by design. It describes STRIDE applied to each element of a data flow diagram, DREAD to rate the risk of the threats found, and LINDDUN for privacy threats, with chapters on secure design for web applications, cloud, serverless and distributed ledgers. For a PHP application sold to a public body, a data flow diagram with a STRIDE table per element is a document that fits an offer and survives an acceptance review.
unserialize() on input.htmlspecialchars() flags in shared templates.expose_php off and remove version headers on the web server.General information on my PHP work is on the PHP developer page.
If your Rome company supplies PHP software to public bodies, send me the tender documents or requirements, the PHP version, the framework and your deadline through the contact page. There is no charge for the first written estimate. The legal reading of a tender stays with your lawyer.
Examples of my work.
The Port Brzeźno Rope Park is a place where both children and adults can experience an unforgettable adventure at height with a good dose of adrenaline in Gdańsk, Poland.
The Quality Watch project was created with the aim of presenting the services of a company specializing in improving customer service standards, quality management, customer experience, customer journeys and customer intelligence.
The Dune City website was built for a prestigious apartment complex located on the 10-kilometre spit separating the Baltic ...
Describe your project by e-mail. I reply within 24 hours.
Describe your projectNeed to show the category hierarchy in your theme? Learn how to get the current category and its parent using get_the_category() and get_category_parents().
Need to get the URL of the first image or link in an article? Prefer DOMDocument over regex. Ready-made WordPress PHP for developers.
On 1 December 2026 Taylor Otwell shipped the Laravel Rust beta, and Laravel Go followed a day later. What the framework contains, what the 18x benchmark really measures, what happens to Laravel PHP and WordPress, and when a rewrite makes sense.
Custom WordPress engineering and architecture.
Scalable headless, ERP, and AI architecture for enterprise.
Stores, checkout flow, and sales logic.
Stability, updates, and post-launch support.
What the monthly care fee covers and what changes it.
Business process automation around WordPress and company systems.
Headless WordPress, Sanity, Strapi, and Contentful with Astro or Next.js.
Astro, MDX, edge delivery, and Core Web Vitals measured on real traffic.

How to start as a WordPress developer in 2026. Local environment, theme and plugin development, REST API and headless paths, security and Core Web Vitals. A practitioner playbook that does not waste your first month.

WordPress 7.0 with AI Client against Astro 7 with the Rust compiler and Vite 8. Speed, cost, SEO and security compared, plus the real bill for my own Astro 6 to 7 migration.

A detailed comparison table of EmDash CMS and WordPress across architecture, security, plugins, AI features, content model, hosting, and ecosystem maturity.