Category: Marketing

  • I built a WordPress Plugin For Generating Images With Nano Banana

    An image of a blogger who takes himself way too seriously for his own good.

    AI is every where. Accept it. Anyway, I had a random thought last night about having a WordPress plugin that allows you to generate images on the fly for your posts. Pictures increase engagement on posts so, what if we just inline Nano Banana directly into Gutenberg?

    This morning I built this plugin which is a simple API call to Google’s Gemini AI Studio through a Gutenberg block.

    1. Type your prompt
    2. Choose your model
    3. Hit generate
    4. Insert

    Simple!

    Nano Banana Image Generator block

    Once the image is inserted into the post it turns the block into a standard image block so its as easy to manage as any other image.

    I submitted the plugin to the official WordPress repository but it takes a while to get approved. So, if you want to add it to your own WordPress instance feel free to message me and I’ll give you access to the repository!

    Don’t miss an update

  • Building in Public – The Automated WordPress Deployment Platform Part 2

    Building in Public – The Automated WordPress Deployment Platform Part 2

    A few days ago I wrote about building an automated WordPress deployment platform using Terraform and AI. Well, i’m happy to report that the entire platform is live and ready for you to explore and launch your own WordPress website.

    Introducing 45Squared’s WordPress deployment platform powered by Ubuntu and Claude. Try it out today at https://ai.45sq.net.

    Let’s talk about how this all works.

    The front end infrastructure that an end user will see is pretty straightforward. I am utilizing an ECS cluster and NextJS to deliver the end user experience. The second portion of the user experience is handled by an AWS API Gateway to manage all of the user credentials, payment processing, sit launch status. Authentication is handled by AWS Cognito. Hate on it all you want, Cognito works just fine when configured correctly.

    Frontend architecture

    Behind the scenes, once a user transaction has completed successfully, the website is provisioned using another ECS task. This container runs through a sequence of steps to provision the AWS EC2 instance for the user to utilize. Each tenant instance is running a hardened Ubuntu image that is built using Packer. I will cover this in another post. Throughout the provisioning process, the task is updating the DynamoDB table so that the user gets a live look into how their website is progressing.

    Provisioning architecture

    Each tenant is given a subdomain as well as the ability to utilize a custom domain name. Each tenant is also given a Cloudfront CDN for global static content distribution. And of course, each tenant receives their own SSL certificate for both their custom domain and their subdomain.

    Each site can be managed by SSM which will eventually be linked into an AI agent for management through Slack or another messaging platform.

    I don’t intend to use this platform to compete with the large players. 45Squared’s vision has always been to serve the small to medium size businesses who want personalized support while still receiving an amazing product. This platform gives them the ability to quickly launch a website and get their company on the world wide web within 10 minutes.

    If you are interested in building out a website using the platform the first few users can receive 50% using code “BETATESTER50”. There are limited redemption so be sure to get going quickly!

    Don’t miss an update

  • Building In Public – Designing an automated WordPress deployment engine with Terraform

    If you didn’t know I built a lot of technical experience by building out WordPress websites. I started a business around it. I did quite well. Lately, I’ve been trying to get back into building websites for small businesses. I find that the space of AI has made some of the bigger players too complex even though they claim to be easy.

    My goal is to create a single web page where a user can describe their website and have it auto provision a full WordPress instance build upon core AWS services. The end result will be a fully managed WordPress instance, backed by AWS’s 99.999% up time. It will be fully automated and take around 10 minutes to have a fully developed website.

    Current Architecture Plans:

    I’m utilizing AWS to handle everything (no surprise). Originally I was going to utilize Step Functions as the provisioner but as I started building I ended up hitting too many roadblocks and restrictions from a timing perspective.

    When dealing with Bedrock the response times can vary. So I made the switch to go with an ECS approach. The control plan/signup page is built there so the provisioner should also just be another task.

    Features:

    • Custom Domains
    • Automated SSL
    • Load balancers
    • Auto healing (through auto scaling)
    • Monitoring

    Essentially all the standard features you would expect from a web host. Just without the design portion.

    This will be a new ongoing series for you all to read about. If you’re interested in following along subscribe to my mailing list!

    Don’t miss an update

  • Building a Python Script to Export WordPress Posts: A Step-by-Step Database to CSV Guide

    Today, I want to share a Python script I’ve been using to extract blog posts from WordPress databases. Whether you’re planning to migrate your content, create backups, or analyze your blog posts, this tool makes it straightforward to pull your content into a CSV file.

    I originally created this script when I needed to analyze my blog’s content patterns, but it’s proven useful for various other purposes. Let’s dive into how you can use it yourself.

    Prerequisites

    Before we start, you’ll need a few things set up on your system:

    • Python 3.x installed on your machine
    • Access to your WordPress database credentials
    • Basic familiarity with running Python scripts

    Setting Up Your Environment

    First, you’ll need to install the required Python packages. Open your terminal and run:

    pip install mysql-connector-python pandas python-dotenv

    Next, create a file named .env in your project directory. This will store your database credentials securely:

    DB_HOST=your_database_host
    DB_USERNAME=your_database_username
    DB_PASS=your_database_password
    DB_NAME=your_database_name
    DB_PREFIX=wp  # Usually 'wp' unless you changed it during installation

    The Script in Action

    The script is pretty straightforward – it connects to your WordPress database, fetches all published posts, and saves them to a CSV file. Here’s what happens under the hood:

    • Loads environment variables from your .env file
    • Establishes a secure connection to your WordPress database
    • Executes a SQL query to fetch all published posts
    • Converts the results to a pandas DataFrame
    • Saves everything to a CSV file named ‘wordpress_blog_posts.csv’

    Running the script is as simple as:

    python main.py

    Security Considerations

    A quick but important note about security: never commit your .env file to version control. I’ve made this mistake before, and trust me, you don’t want your database credentials floating around in your Git history. Add .env to your .gitignore file right away.

    Potential Use Cases

    I wrote this script to feed my posts to AI to help with SEO optimization and also help with writing content for my other businesses. Here are some other ways I’ve found this script useful:

    • Creating offline backups of blog content
    • Analyzing post patterns and content strategy
    • Preparing content for migration to other platforms
    • Generating content reports

    Room for Improvement

    The script is intentionally simple, but there’s plenty of room for enhancement. You might want to add:

    • Support for extracting post meta data
    • Category and tag information
    • Featured image URLs
    • Comment data

    Wrapping Up

    This tool has saved me countless hours of manual work, and I hope it can do the same for you. Feel free to grab the code from my GitHub repository and adapt it to your needs. If you run into any issues or have ideas for improvements, drop a comment below.

    Happy coding!

    Get the code on GitHub