Tencent has introduced a new benchmark, ArtifactsBench, that aims to fix current problems with testing creative AI models. Ever asked an AI to build something like a simple webpage or a chart and received something that works but has a poor user experience? The buttons might…
Streamlining the path from prototype to production
LLMOps is emerging as a critical enabler for organizations deploying large language models at scale….
How to Refactor Your Outdated WordPress Code With AI — Speckyboy
Websites don’t age gracefully. Left unattended, they inevitably fall behind the latest best practices and technologies. We especially see the impact on sites built with WordPress.
It’s not that the content management system (CMS) is unstable – quite the opposite. It’s just that the software has been in existence for over 20 years. Thus, you’ll find old WordPress sites all over the interwebs.
Custom code is a common culprit. That snippet you wrote a few years ago may not work so well these days. It could be incompatible with the latest version of PHP, hinder performance, or contain security flaws. You might also be reliant on outdated JavaScript libraries or CSS techniques.
Part of bringing your site up to modern standards means refactoring outdated code. That can be a tough task, but you don’t have to do it alone. You can use AI tools to help identify and fix issues.
We’ll show you how AI can bring new life to old code. The result is a website that stays current and is better equipped for the future.
What AI Can and Can’t Do for Your Code
First, let’s set some reasonable expectations for refactoring code with AI. These tools can be helpful, but don’t expect miracles.
Consider the types of issues and the amount of code you share. For example, uploading an entire theme and asking AI to fix every error it detects won’t go very well. The large language models (LLMs) we’ve used lack context and can’t “think” in terms of a whole application. Remember, it doesn’t have the rational logic of a human programmer.
Instead, focus on a code snippet or a single file within a theme or plugin. A one-at-a-time approach usually yields the best results.
Also, be sure to provide as much information as possible in your prompts. Spell out your goals and any errors you’re experiencing in plain language. The more details you share, the more likely AI will be able to help.
It’s also worth noting that AI may not be up to date on the latest versions of WordPress, PHP, or other items. That great new technology that came out today won’t yet be included in the model. Keep that in mind when asking for help.
The right tool makes refactoring code easier. However, you’ll have more success treating it as a trusty sidekick rather than a superhero.
Improve Your Code’s PHP Compatibility
PHP versions are only supported for a limited time. Web hosts have also been known to abandon support for outdated code. Thus, a site built in the days of PHP 7.4 may not be compatible with 8.x or your web server. That could mean a broken feature or a site that refuses to load.
You can debug your site via a local WordPress install or a staging environment. Be sure to turn on WordPress debugging and track PHP errors. The error messages should provide clues to where the offending code resides.
Then, take these errors to your favorite AI tool and, one by one, try to resolve them.
We produced the above error when running an old theme in PHP 8.2. To solve it, we asked ChatGPT for help:
Our ChatGPT Prompt:
The following PHP snippet produces an error in PHP 8.2: "Fatal error: Uncaught Error: Call to undefined function create_function()"
Please make it compatible with PHP 8.2.
Our PHP Code:
add_filter( 'wp_title_rss', create_function( '$a', 'return "";' ) );
ChatGPTs Response:
The create_function() function was deprecated in PHP 7.2 and removed in PHP 8.0, which is why you're seeing this fatal error in PHP 8.2.
To make the code compatible with PHP 8.2, you should replace create_function() with an anonymous function using the modern closure syntax. Here's the updated version:
ChatGPT’s Code Output:
add_filter( 'wp_title_rss', function( $a ) {
return '';
} );
We edited our snippet to use the suggested code, and the error was fixed.
Modernize Your JavaScript
Does your legacy site suffer from old and bloated JavaScript? AI may have the perfect antidote.
Scripts written five or more years ago are likely dependent on an old-school library. You might, for example, remember all the glory that was script.aculo.us. A recent query shows it hasn’t been updated since 2010. Yikes!
WordPress bundles jQuery, which is still maintained. That doesn’t mean your custom scripts are using the latest code, though.
Even if an old script works, there are likely more efficient and secure options available. It might hinder performance or make it easier for a hacker to exploit your site.
AI can help you refactor your scripts to use newer libraries. You might also consider switching to vanilla JavaScript, which is more powerful than ever.
In this example, we asked ChatGPT to convert a jQuery script to vanilla JS. The script adds or removes a CSS class depending on a user action.
Our ChatGPT Prompt:
Please convert this jQuery script to use vanilla JavaScript instead:
Our jQuery Code:
jQuery(document).ready(function() {
jQuery("#sticky-sidebar").addClass(localStorage.getItem('savestickysidebar')) ;
jQuery('#sticky-sidebar-toggle').on('click', function() {
jQuery('#sticky-sidebar').toggleClass('hidden');
if(jQuery('#sticky-sidebar').hasClass('hidden')){
localStorage.setItem('savestickysidebar', 'hidden');
}
else{
localStorage.removeItem('savestickysidebar');
}
});
});
ChatGPT heeded our call for an independent script.
ChatGPTs Response:
Here is the vanilla JavaScript equivalent of your corrected jQuery code:
ChatGPT’s JavaScript Output:
document.addEventListener('DOMContentLoaded', function() {
var sidebar = document.getElementById('sticky-sidebar');
var savedClass = localStorage.getItem('savestickysidebar');
if (savedClass) {
sidebar.classList.add(savedClass);
}
var toggleButton = document.getElementById('sticky-sidebar-toggle');
toggleButton.addEventListener('click', function() {
sidebar.classList.toggle('hidden');
if (sidebar.classList.contains('hidden')) {
localStorage.setItem('savestickysidebar', 'hidden');
} else {
localStorage.removeItem('savestickysidebar');
}
});
});
Converting this script gives us one less jQuery dependency to worry about. AI made the process that much easier.
Give Old Code a New Lease on Life
Refactoring your WordPress site’s code is part of a good maintenance routine. It keeps your site safe, performant, and functional.
In days past, these tasks could be painfully difficult. You had to research, test, and write a fix. PHP and console errors were helpful, but manual labor was still required. You might spend days or weeks obsessing over a piece of unruly code.
AI tools have the potential to shorten the entire process. They can often tell you what’s wrong and how to fix it. Even if their first answer doesn’t get you 100% of the way there, they usually point you in the right direction.
So, don’t be afraid to dig into that old code. A few prompts might be all you need to give it a fresh coat of paint.
Related Topics
Apple loses key AI leader to Meta
Apple is nursing a fresh wound this week after losing one of its most crucial AI leaders to Meta. Ruoming Pang, the executive who oversaw Apple Intelligence, has jumped ship to join Meta’s new Superintelligence Labs. Pang wasn’t just any Apple employee. He led a 100-strong…
Save on YoloBox All-in-One Live Streaming Devices – Sale Ends 7/31/25!

Looking for an all-in-one live streaming and video production solution? The YoloLiv YoloBox family is your answer! These powerful, portable devices combine video encoding, switching, monitoring, and recording into one easy-to-use system—no PC required. Ideal for live streaming sports, worship services, corporate events, and more, YoloBox makes professional-quality streaming simple and reliable.
Act now—this exclusive YoloBox sale ends July 31, 2025! Call Videoguys at 800-323-2325 for expert advice and find the perfect YoloBox to fit your live production needs.
|
|
|
|
|
Better CSS Shapes Using shape() — Part 4: Close and Move
The shape() function’s close and move commands may not be ones you reach for often, but are incredibly useful for certain shapes.
Better CSS Shapes Using shape() — Part 4: Close and Move originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get…
20+ Best Free Food Icon Sets for Designers — Speckyboy
Food icons are used everywhere. You’ll see them on restaurant menus, mobile apps, food blogs, delivery sites, and product packaging. They help make content easier to follow, add a bit of character, and guide users through information without needing much explanation. When designed well, icons support the layout without getting in the way.
If you’re working on a food-related project, building every icon from scratch usually isn’t the best use of time. Free icon sets can help speed up the process and maintain design consistency. You get a ready-made foundation to build on, which is especially useful when you’re under a deadline.
This collection shares a selection of free food icon sets worth keeping on hand. Each one has been picked for quality, style, and usefulness. Whether you’re designing something simple or more detailed, you’ll likely find something here that helps you get the job done faster and better.
Free to Download | 100 Icons in EPS, SVG & PNG Formats
23 Icons in AI, EPS & SVG Formats
Free to Download | 15 Icons in Illustrator AI Format
50 Icons in EPS, PNG, PSD & SVG Formats
Free to Download | 40 Icons in Figma Format
25 Icons in PNG, SVG, EPS, AI & Figma Formats
Free to Download | 30 Icons in AI, EPS, SVG & PNG Formats
40 Icons in SVG, AI, EPS, PNG & Figma Formats
Free to Download | 25 Icons in Figma Format
25 Icons in AI, EPS, PNG & SVG Formats
Free to Download | 25 Icons in AI, EPS, SVG & PNG Formats
50 Icons in PNG, PSD, EPS & SVG Formats
Free to Download | 25 Icons in AI & EPS Formats
40 Icons in AI, EPS, SVG & PNG Formats
Free to Download | 20 Icons in Figma Format
20 Icons in EPS, PSD, SVG & PNG Formats
Free to Download | 20 Icons in Illustrator EPS Format
Free to Download in Figma Format
Free to Download 20 Icons in Sketch & Figma Formats
Free to Download in Illustrator EPS Format
Free to Download | 30 Icons in Figma Format
Free to Download | 12 Icons in Illustrator AI Format
Free to Download | 50 Icons in Illustrator EPS Format
Free to Download | 20 Icons in SVG Format
Free to Download | 22 Icons in SVG & PNG Formats
Free to Download | 90 Icons in Figma Format
Free to Download | 80 Icons in AI, EPS, SVG & PNG Formats
What to Look for in a Good Food Icon Set
Style matters. Icons in the same set should match. That means using a consistent look, like outline, filled, flat, or line-based. If the style is mixed, it can make your layout feel disjointed.
Pay attention to the file formats. SVG and PNG are the most common and work well across many platforms. If you use design software like Illustrator (AI & EPS), Photoshop (PSD), Sketch, or Figma, it helps if the set includes files you can open and edit directly.
Always check the license. Some icon sets are only free for personal use. Others are cleared for commercial work. It’s best to know upfront so you don’t run into problems later.
Think about variety too. A good food icon set should include more than just one or two items. Look for icons that cover different types of food, drinks, kitchen tools, and any other food related items.
Final Food Icon Thoughts
Free icon sets can still be high quality. Many are created by professional designers and made available for public use. If you come across a set you like, bookmark the source. Having a few trusted libraries makes future projects easier to start.
Try to keep your icons consistent throughout a design. Mixing styles across different sets rarely works out. It’s usually better to stick with one well-made pack that covers everything you need.
A small collection of reliable, free food icon sets can save time and make your work look more polished. They’re useful to have, even if you don’t need them right away.
More Free Icon Sets
Related Topics
Tencent Hunyuan3D-PolyGen: A model for ‘art-grade’ 3D assets
Tencent has released a model that could be quite literally game-changing for how developers create 3D assets. The new Hunyuan3D-PolyGen model is Tencent’s first attempt at delivering what they’re calling “art-grade” 3D generation, specifically built for the professionals who craft the digital worlds we play in….
The Sequence Radar: From Model to Team: Several Models are Better than One: Sakana’s Blueprint for Collective AI
Sakana’s new model combines different models seamlessly at inference time….