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 that handles personal data meets the privacy rules in its first requirement, not in its privacy policy. I am Mariusz Szatkowski, working remotely from Gdynia on PHP and WordPress since 2006, with every step agreed in writing. I am not a lawyer. Whether a processing activity is lawful is for you and your adviser. What I build is the code and the records that make the decisions visible.

Birkelunden in Oslo. Photo: Leonhard Lenz, CC0, Wikimedia Commons.
Yes. Personopplysningsloven carries the date 15 June 2018 (LOV-2018-06-15-38) and has been in force since 20 July 2018, according to Lovdata. Section 1 is titled “Gjennomføring av personvernforordningen”. It says the regulation applies as law with the adaptations that follow from Annex XI, Protocol 1 and the EEA Agreement otherwise. Chapter 6 of the act covers supervision and complaints, and chapter 7 covers sanctions.
For a Norwegian company this means the GDPR text is the working rulebook, and Datatilsynet is the authority that reads it. A PHP application built in Oslo, in Gdynia or anywhere else is judged against the same article numbers.
Datatilsynet’s page on built-in privacy and privacy by default states that Article 25 of the GDPR requires privacy to be built into processing activities. It calls built-in privacy a central requirement of personopplysningsloven and says it means considering privacy in every development phase of a system. The requirement covers all means used to process personal data, regardless of the size of the business.
Three statements from that page matter to anyone who writes code for a client:
Datatilsynet also publishes a development guide, Programvareutvikling med innebygd personvern. Its page for suppliers to the health and care sector calls the guide a supplement to the company’s own development method and says that development should follow a method with fixed activities so that the end product is robust. The same page names seven activities: training, requirements, design, coding, test, release and operation. I could not open the guide’s own web page, so the sections below follow the poster that Datatilsynet publishes with it and the pages above. If your project is regulated by sector rules, read the guide itself.
The poster starts with training: a differentiated training plan for the professions involved in development, anchored in management. For a project with one developer and one client contact, that becomes a short written agreement on who reads which rules before building starts.
At the requirements stage the poster asks for an overview of:
This list is the most useful single page for scoping a PHP build. In a project it turns into a table in the repository, one row per field, with the purpose, the basis, the retention period and the role that may read it. The schema, the forms and the admin screens are then written against that table. When a requirement changes, the table changes first.
Datatilsynet’s own examples show what the table does. For an online bookshop it says birth date and phone number are not needed to sell books, so those fields should not be mandatory in the order form, and e-book sales get a separate form without address fields. For an online shop with a customer database it says marketing analysis and purchasing-power analysis are not part of the original purpose, so the controller has to assess compatibility or leave those features out. The page gives the short rule “select before you collect”.
At the design stage the poster asks that the rights of the people concerned are reflected in the design: limit and minimise the data, anonymise or pseudonymise, aggregate, and make privacy the default setting. It also asks for an analysis of how the software could be misused, plus attack surface analysis and threat modelling.
In PHP this decides things that are expensive to change later:
Datatilsynet’s page on privacy by default adds that defaults must protect the rights of the people concerned as far as possible, and that data must not be kept longer than necessary for the purpose. Organisations must set and justify retention periods, and deletion can be automatic or manual after that time. Anonymisation counts as deletion. A membership system is the page’s example: data is deleted when the membership ends and no legal basis for keeping it remains, and the controller moves from manual to automated deletion.
A retention rule can be a small, testable function with the period read from configuration, so the number lives in one place:
<?php
declare(strict_types=1);
// Deletes closed memberships older than the configured retention period.
function purgeExpiredMembers(PDO $db, DateTimeImmutable $now, int $retentionDays): int
{
$cutoff = $now->modify("-{$retentionDays} days")->format('Y-m-d');
$stmt = $db->prepare(
'DELETE FROM members WHERE membership_ended_on IS NOT NULL AND membership_ended_on < ?'
);
$stmt->execute([$cutoff]);
return $stmt->rowCount();
}The function takes the clock as an argument, so a test can pass a fixed date and assert how many rows go. The retention period itself is not a developer decision. It comes from the requirements table.
For coding the poster lists several measures:
Four of these have direct PHP counterparts.
Permitted frameworks and libraries. The approved list is the composer.json of the project plus a short note on why each package is there. Adding a package is a decision that a person with authority makes, not a side effect of a quick fix.
Known vulnerabilities in dependencies. The Composer manual describes composer audit as a check of installed packages against policies such as security advisories, using the Packagist.org API by default. With the --locked option it audits the packages in the lock file regardless of what is currently in the vendor directory, and it exits with code 1 when it finds packages matching the policies. Run in the build pipeline, it turns the poster’s “update those with known vulnerabilities” into a failing check:
composer audit --locked --format=plainSQL queries. The PHP manual says that if an application exclusively uses prepared statements, the developer can be sure that no SQL injection will occur. It adds the caveat that SQL injection is still possible if other parts of the query are built with unescaped input. The poster names SQL injection and cross-site scripting as the known flaws to test for. The consequence for code review is simple: a query built by concatenation is a finding, whatever the input looks like today.
Passwords. The manual for password_hash() says the PASSWORD_DEFAULT constant is designed to change over time as stronger algorithms are added, so the result can grow, and it recommends a column that can expand beyond 60 bytes, with 255 bytes a good choice. It also says the function creates a secure salt automatically and recommends against passing one. A schema with a 60-character password column is a design defect that the requirements table would not catch, and a code review would.
For logging, the poster’s point is about what the application writes down. Request logs, exception messages and queue payloads often carry email addresses, names and form content. The remedy is a rule decided at the requirements stage and checked in review: which fields may appear in a log line, and for how long logs live.
The poster puts security testing inside testing. It asks to test whether the privacy and security requirements are implemented, and implemented correctly, and to run dynamic testing, fuzz testing and penetration testing or vulnerability analysis. It names cross-site scripting and SQL injection and asks to test all input fields and interfaces, with the OWASP Testing Project as an example. It also asks to verify that attack vectors found in the design phase were handled and that new ones introduced during coding were found. Test data should be fictitious or synthetic.
Two habits make this practical in a PHP project:
Whether a pen test is needed for a given application is a risk decision for the controller. The poster treats it as part of testing.
For release the poster asks for a plan for incident handling that covers tasks, incidents, authority and roles after release, a full security review in which the data protection officer and a security adviser verify that the requirements are implemented and work as intended, and approval of the release by someone with authority. It also asks to archive all assessments, analyses, tests, documentation and code.
For operation it asks to handle incidents and deviations according to the plan, and to run a management system for privacy and information security that covers acquisition, operation and maintenance, with routines for logging, testing and measuring the effect of organisational and technical measures.
In a project this becomes three files in the repository and one staging copy:
The staging copy, with synthetic data, is where each build runs first.
Maintenance after release belongs to the same chain. Updates to PHP, to the framework and to Composer packages are decisions with a record. If you run WordPress next to a custom application, the WordPress maintenance page describes how updates run on a staging copy first.
Datatilsynet’s page on responsibility says the controller must assess whether third-party solutions really have built-in privacy, also when they are developed externally. The controller must require, assess and make sure that processors meet the requirements, and do it again at regular intervals. Suppliers of products and services should aim to develop them in line with the requirement, so that customers can use them.
For a company that orders a PHP application, the practical reading is a short set of questions put to the developer before the contract is signed, and again at each release:
A written processor agreement belongs to the project when the developer gets access to personal data. The GDPR article that governs it is Article 28, and the template and wording are for your adviser.
Datatilsynet’s page on enforcement says the authority can supervise compliance with the privacy by design requirement, under Article 58 of the GDPR, and that corrective measures include administrative fines or an order to bring the processing into line with the law. When a fine is imposed, it says, the assessment of a breach of privacy by design is a particularly important factor in setting the size of the fine. The page gives no examples of fines, and I give none here.
composer audit --locked in the build and treat a non-zero exit as a failed build.My full PHP offer is described on the PHP developer page.
If you plan a custom PHP application in Oslo that handles personal data, send me the scope, the data it holds, the hosting and your deadline through the contact form. For an Oslo project the first written estimate is free of charge. Which legal basis you rely on, and whether you need a data protection impact assessment, is for you and your adviser to decide.
Examples of my work.
like2slide.com is a website for the ski, snowboard, and wakeboard community, built for inspiration, publishing, and stable operation.
marcoaldany.pl is a WordPress website built to present personalised services to show how this system can support companies offering personalised services or...
The website mavicon.pl has been designed with a view to providing a comprehensive presentation of the company’s offerings, which are based on innovative tech...
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.