Home Backend Development PHP Tutorial Legacy WordPress web development workflow

Legacy WordPress web development workflow

Jul 24, 2024 am 12:56 AM

Legacy WordPress web development workflow

Before you accept a project involving an existing WordPress website, ask yourself some important questions:

  • Do we want to work with WordPress at all? (still? again?)
  • Are we still ready to do it? What will we probably need to learn?
  • Which legacy decisions and technical debt will we have to deal with?
  • Do we know if it is possible to achieve our goals using the given technology (e.g. a certain theme or page builder)?
  • Do our clients even know what they want or need?
  • Do we suspect they have additional implicit requirements?
  • Do they have enough budget to pay for our work?
  • Are we still willing to accept the assignment?

As you are still reading this article, I suspect that - despite having answered "no" or "I don't know" at least 1x - you are desperate enough or have other reasons like networking/marketing or hoping for a follow-up project and you have agreed to work with a legacy WordPress website that already starts to cause trouble.

We can reduce risks and troubles by using common sense and extra careful measures. Most importantly, always back up all data before making any changes!

What I do when I have to work with page builders to modify existing legacy websites:

  • Investigate the existing setup by
    • taking screenshots
    • running automated audits like
      • PageSpeed Insights
      • WebPageTest
      • WebsiteCarbon
      • WAVE accessibility check
    • and saving the current state to web.archive.org
    • for the most important page types, e.g.
      • the home page
      • another static page
      • a blog archive (category page)
      • a single blog entry.

Next:

  • Make a backup! UpdraftPlus is a good tool as its backups can be used for cloning WordPress websites, including purchased plugins, to development and staging systems.

  • Download the backup files to my local computer!

  • Setup a development instance! We can start with a 1-click-installation on shared hosting, or use a Docker-based template like wp_cli_docker for local development.

  • Restore/migrate the original content to your local copy. UpdraftPlus will adjust all absolute URLs and ensure a working media library on the target instance.

  • Reset the main admin user (either in wp-admin or using the mySQL cli inside the database Docker container) and change its email address.

  • Delete all other users!

  • Delete all personal and customer data!

  • Change the site title and the bookmark icon. My local development setups titles usually start with "Local" and the icons can't be confused with the production ones.

  • Update WordPress and its plugins in my local development instance.

  • Verify that everything still works!

Don't update any part of a client production site before creating and downloading a full backup, and don't do it before taking screenshots and saving archive examples! If anything breaks, we need to know the last working state!

Ask your client if they prefer an "under construction" or "maintenance mode" notice while you are making changes to their production site. Elementor has a built-in feature, but WordPress still hasn't, so we must rely on third-party plugins. I tried Under Construction which broke my localhost instance with a "white screen of death" due to a PHP deprecation message that shouldn't be fatal in production, but I still didn't want to risk it. Thanks to a hint on Team Streber's blog, I went for Maintenance by WebFactory Ltd, which seems good enough, at least for a short downtime, even without paying for PRO features.

  • Examine the existing setup for custom code and styles, e.g.
    • Appearance -> Customize -> additional CSS
    • Widgets
    • any other place where themes or custom plugins allow to define custom code
    • custom PHP code in a child theme;
  • copy the existing code to project files like custom.css, custom.js, example-child/functions.php and commit it.

  • Disable performance, caching, and security plugins locally before proceeding with the actual web development. They don't help while developing, but their optimization can get in our way, cause outdated page styles and waste memory and energy.

  • If we want to show our customer a preview to test, we can setup a public staging instance, transfer a new backup from localhost (which is already free from customer data and optional plugins), and set up password protection to make sure only the right people have access to our stage!

  • If we don't do staging, we can add a draft page on their production server where we can show some progress and make sure that we are really able to copy our work from localhost to production selectively.

Next, I try to find out how best to work with the given setup, how to persist my changes, and how to safely transfer them to another page or instance without breaking or forgetting anything.

As a web developer with a frontend focus, I try to use global CSS as much as possible. I know this contradicts the intention of no-code page builders, but so does coding in general. I found this to be a pragmatic compromise between staying in control of my code and not completely throwing away existing code and software.

Global custom CSS is prominent and easy to find compared to element-specific custom CSS or plugin-specific configurations that might stop working after the next major update.

Depending on the website's complexity and our experience with its technologies, we might have spent at least half an hour or the whole day getting a grip on a legacy setup without any visible achievement. Before we start coding, we should review our assignment and find an easy subtask to begin with, ideally something that causes a change that is obvious at first sight.

So we can finish our first hour or day of work with a feeling of achievement.

Further work

When proceeding with our work, we must stay careful.

Communication

  • Inform our clients what we are about to do, especially when it involves risks our downtimes!
  • Turn our phone on an watch our inbox, chat and project management tools for any important inbound messages!
  • Check communication for possible misunderstandings, and rather ask a silly question than make a wrong assumption!

Safety

  • Always make sure we know which instance/server we are working on!
  • Never work with outdated data! Reload content before resuming work after a break!
  • Save and commit changes frequently!
  • Don't stop creating and downloading backups!

Payment and recommendation

  • Always make the client happy, or at least don't leave them disappointed or angry!
  • If a project fails, or your client thinks it does, discuss solutions and possible exit and handover scenarios. We could also offer clients a reasonable discount when writing our final invoice.
  • Bailing out might prevent making things worse and save time and money sometimes, but it can be better to invest an extra effort and save a project without telling the client, and turn an economic loss into a marketing investment: a happy customer might recommend our services to others.

Takeaways

  • Take notes! If you find out "dirty secrets" or clever workarounds, if you learn new concepts related to WordPress or (web) development in general, write it down in a digital medium and be verbose enough to be able to find the information next time you need it!

As you can see, I keep posting about WordPress. I keep taking on clients with legacy WordPress websites, and I don't rewrite their code from scratch. I hope that my hints and rants turn out to be helpful for anyone. Publishing this kind of post is another way to preserve my knowledge and find it the next time I google an error message.

The above is the detailed content of Legacy WordPress web development workflow. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1669
14
PHP Tutorial
1273
29
C# Tutorial
1256
24
Explain secure password hashing in PHP (e.g., password_hash, password_verify). Why not use MD5 or SHA1? Explain secure password hashing in PHP (e.g., password_hash, password_verify). Why not use MD5 or SHA1? Apr 17, 2025 am 12:06 AM

In PHP, password_hash and password_verify functions should be used to implement secure password hashing, and MD5 or SHA1 should not be used. 1) password_hash generates a hash containing salt values ​​to enhance security. 2) Password_verify verify password and ensure security by comparing hash values. 3) MD5 and SHA1 are vulnerable and lack salt values, and are not suitable for modern password security.

PHP and Python: Comparing Two Popular Programming Languages PHP and Python: Comparing Two Popular Programming Languages Apr 14, 2025 am 12:13 AM

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP in Action: Real-World Examples and Applications PHP in Action: Real-World Examples and Applications Apr 14, 2025 am 12:19 AM

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

How does PHP type hinting work, including scalar types, return types, union types, and nullable types? How does PHP type hinting work, including scalar types, return types, union types, and nullable types? Apr 17, 2025 am 12:25 AM

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values ​​and handle functions that may return null values.

The Enduring Relevance of PHP: Is It Still Alive? The Enduring Relevance of PHP: Is It Still Alive? Apr 14, 2025 am 12:12 AM

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP and Python: Different Paradigms Explained PHP and Python: Different Paradigms Explained Apr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

How do you prevent SQL Injection in PHP? (Prepared statements, PDO) How do you prevent SQL Injection in PHP? (Prepared statements, PDO) Apr 15, 2025 am 12:15 AM

Using preprocessing statements and PDO in PHP can effectively prevent SQL injection attacks. 1) Use PDO to connect to the database and set the error mode. 2) Create preprocessing statements through the prepare method and pass data using placeholders and execute methods. 3) Process query results and ensure the security and performance of the code.

PHP and Python: Code Examples and Comparison PHP and Python: Code Examples and Comparison Apr 15, 2025 am 12:07 AM

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

See all articles