source
Continue readingMonthly Archives: August 2024
8 Mistakes I Made When Building a WordPress Plugin With AI
[ad_1] Had I planned it out ahead of time, I would’ve went with the tabbed layout that I eventually used, right from the beginning. The overall process would have gone much smoother. Here’s what I think works better Once you decide on what you want your plugin to do on a broad-level, find existing plugins that do the same thing or that have some overlap. Install them on a dummy site using TasteWP and use them. But don’t just use them like a regular user. Use them like a UX researcher would use them. Make careful notes on how different things work. What do you like? What would you do different? After you perform this plugin testing, organize your notes. Then put together a detailed description of your prototype. Ask yourself how users will interact with it. Will they use shortcodes? Will they add extra blocks inside the block editor? Will there be a settings area on the back end? Cover all your bases. Consider using wireframes to visually map out how users will navigate their way around your plugin. You can get free wireframes over at Figma. When you finish the above, use your detailed description and possibly any wireframes you create, to give your first prompt to ChatGPT. My recommendation for the prompt is to start small and gradually build. This way you can more easily isolate and fix any bugs that come up. Using my plugin as an example, if I was to do it all over again, I’d first give GPT a broad overview of what I want to do. I’d also mention the tools and scripts I want to use. Then I would begin building only the first effect along with the corresponding area for it on the back end. I’d test it to make sure it works. If all was well, I’d add the next effect, and so on. Mistake #2: Ignored WordPress coding standards at the beginning Another big mistake I made was that I didn’t realize how big of a gap there is between simply building a plugin that works and building a plugin that is worthy of submission to the WordPress repository. You might be surprised, but going from zero to functioning plugin is much easier and faster than going from functioning plugin to well-coded plugin. To put this in real-number terms: It only took me about two or three days to build a functioning plugin, but it took me another seven weeks of work before I got it to a point where I was able to submit it to the WordPress repository for consideration. Even if your ultimate goal is not to submit your plugin and you only want it for yourself or a client’s website, you should still follow coding best practices. This will ensure that your plugin doesn’t cause other things to break on your site and doesn’t put an unnecessary strain on your site’s resources. Here’s what I think works better Make sure you tell ChatGPT (or Claude) right from the beginning that whatever code it generates should follow WordPress coding standards. If you’re planning on submitting your plugin to the WordPress repository, then for good measure, also add that any indentations should be done using tabs and not spaces. GPT has a tendency to default to spaces, but this goes against the coding standards. If you don’t nip it in the bud right from the get go, then you’ll have to deal with it later when you do your linting. Might as well do it correctly from the start. Mistake #3: Allowed GPT to constantly regenerate entire code files One thing you might be tempted to do when you have very little experience working with code is to ask ChatGPT to regenerate entire code files when you’re debugging. I was guilty of this, until I realized it was getting me nowhere. It’s not necessarily an issue if you’re dealing with a relatively small JavaScript file that’s 50 to a 100 lines long. However, as your plugin gets more complex and your main PHP file starts growing considerably, then it becomes highly problematic. For one, it takes GPT some time to generate that code. For example, let’s say you have a bug in a file that contains 800 lines of code. Now imagine the actual problem is found on only one of those 800 lines. Does it make sense to sit in front of your monitor for five minutes, watching GPT regenerate 799 lines that it doesn’t need to? No, it doesn’t. And here’s the other problem: As the length of your code grows, ChatGPT’s memory worsens. What ends up happening if you allow it to regenerate very long sections of code, is that it won’t only tweak the problematic lines you’re trying to debug, but it’ll also accidentally change other lines. So now you might fix the error you wanted to fix, but you’ll be stuck with some new error(s). If you continue going about it the same way, it will leave you in an endless loop of debugging. You’ll feel like you’re trapped in the Matrix. Neo won’t be coming to save you though. You must save yourself. Here’s what I think works better When you’re debugging, make sure to include very specific instructions to ChatGPT in your prompts to keep it laser-focused. After some trial and error, I found that telling it to do the following worked well: Please do not regenerate the entire file for me. Analyze and isolate the specific lines of code that you believe are causing the problem and show them to me. Explain what specifically about those lines you think might be the issue. Then explain how you are going to change the lines and what you expect the outcome to be as a result of the changes. Finally, please give me the updated lines in a code snippet so I can copy and paste them. Mistake #4: Used plain vanilla CSS instead of BEM CSS If there’s
Continue readingMinneapolis business owners face ‘almost impossible’ challenges including crime, regulations – Fox News
Minneapolis business owners face ‘almost impossible’ challenges including crime, regulations Fox News
Continue readingDenver businesses are leaving South Broadway. What’s pushing them out? – Denver 7 Colorado News
Denver businesses are leaving South Broadway. What’s pushing them out? Denver 7 Colorado News
Continue readingBusiness leaders discuss summer tourism in Midland, region – Midland Daily News
Business leaders discuss summer tourism in Midland, region Midland Daily News
Continue reading‘Business Email Compromise’ scam sabotages SoCal couple’s dream to build theater – ABC7 Los Angeles
‘Business Email Compromise’ scam sabotages SoCal couple’s dream to build theater ABC7 Los Angeles
Continue reading9 Business Ideas For Teens In 2024 – Forbes
9 Business Ideas For Teens In 2024 Forbes
Continue reading<! Is this title blurred? !>
[ad_1] <! Is this title blurred? !> [ad_2] View Reddit by KevinTylerisHandsome – View Source
Continue readingHas Lando Norris betrayed a weakness he can ill-afford in his world title fight with Max Verstappen? Writes JONATHAN McEVOY
[ad_1] Part of Lando Norris’s attraction to his fans, and a statement on his decency as a man, is his openness. But hearing him talk of how he gets so nervous before races that he cannot eat or drink, it was difficult not to think he betrayed a weakness he can ill-afford in his flickering world championship fight. ‘I get so nervous for qualifying,’ he admitted in Monza on Thursday. ‘For the races, I get just as excited and nervous. I don’t eat anything on Sundays. I struggle to drink.’ More buttoned-up forebears – Michael Schumacher, Fernando Alonso, Lewis Hamilton and Max Verstappen – would never have revealed the same for fear of looking vulnerable to their rivals. Would any of them even suffer from the same affliction of nerves? Lando Norris has revealed how on the day of racing he struggles to eat or drink due to nerves Norris can put further pressure on the world title race if he wins this weekend’s Monza GP Norris has a different mental approach to that of fellow British driver Lewis Hamilton (right) It is hard to believe they would. Schumacher, a beast of a competitor, flew straight over from his mother’s bedside, hours after she died, to win the San Marino Grand Prix the next day. Admittedly, tears rolled down his face. There was emotion there behind the Teutonic mask. Alonso, the inscrutable machine, doesn’t possess nerves. Hamilton, more sensitive than Alonso, is a harder-than-nails racer. Verstappen was born, and reared, to race and no aspect of his craft causes him to fret. He is as close to fearless as it comes. Even Nico Rosberg, an underrated champion, didn’t let slip how hard he found it taking on Hamilton during their time together at Mercedes until he had screwed every last ounce of mental fortitude to take the title in the closing race of 2016. Max Verstappen (pictured) is different to Norris and you sense the Red Bull champion doesn’t face similar nerves Norris’s openness, which has seen him talk before of his mental struggles, fits an age when sharing inner turmoil is hailed Norris has his sights firmly locked on ending Verstappen’s three-year stranglehold on the F1 world championship Within the week, he had retired. As Roberto Duran shouted under an onslaught from Sugar Ray Leonard: ‘No Mas.’ Rosberg told me he took after his German mother rather than his gruffer father, Keke. Norris’s openness, which has seen him talk before of his mental struggles, fits an age when sharing inner turmoil is hailed. Who is to say his approach won’t help him? It’s just that it is a different language from the past. A ROYAL REQUEST If only Princess Anne had been on the red-eye flight from London to Milan on Thursday. For a reason I shall explain that’s because when you wake at 4.30am and board before seven you don’t welcome infernal announcements interrupting your dozing. Especially when you are being informed it is a no-smoking flight – haven’t they all been for about 30 years? – and promised a ‘complimentary’ bottle of water as if it’s the Elgin Marbles. Princess Anne once gave the order that verbiage over the public address on a plane was unwelcome Not wishing to drop names, but I was with her HRH on flight BA 2012 that transported the Olympic flame from Greece to Britain for the torch relay. She had given the order that verbiage over the public address was unwelcome. I’m with you, ma’am. MONZA COULD SCRAP PRESS DIGS Monza drips with charm and history. Our media centre overlooks the pit straight which is flooded by a sea of red fans after the race. It’s some scene. A moving one for it represents a nation’s love affair with Ferrari, whatever you think of them. Nice pasta and tiramisu were laid on for us hacks on Thursday, but a worrying rumour circulates that our space will be requisitioned to house VIPs paying top dollar from next year. My pal in the Italian press corps, Daniele Sparisci, tells me nothing is decided yet. The campaign for preservation is on. The luxurious Monza circuit could scrap the current press room next year to make way for top-paying VIPs F1 stars Sergio Perez (left) Alex Albon (middle) and Norris (right) take part in Thursday’s press conference Formula One’s longest servant Who has been to the most Formula One races than anyone ever? A compelling answer was the great Herbie Blash, deputy race director to the highly respected Charlie Whiting. Both were Brabham boys under Bernie Ecclestone. I suggested to Bernie once that Herbie was top of the list. ‘No, I think I am,’ said the sport’s former impresario. He reasoned that he was at the first world championship race at Silverstone in 1950 and so had the edge. While Nino Farina triumphed for Alfa Romeo in the inaugural British Grand Prix, 19-year-old Ecclestone slept in his car the night before competing in the Formula Three race. He lost to a 20-year-old called Stirling Craufurd Moss. But there was no shame in that. On Thursday, at Pirelli’s garage a commemorative paddock pass was awarded to the member of the media room who has attended most races: Giorgio Piola. A revered technical illustrator, he has notched 900 races, dating back to the 1969 Monaco Grand Prix. He was 19 then. No luck for Logan Logan Sargeant has been dropped by Williams to be replaced by Franco Colapinto, a 21-year-old Argentine competing in Formula Two. Neither driver has a chance to fill the team’s race seats next year, with Carlos Sainz coming in to partner Alex Albon. Yes, Sargeant was accident prone to say the least, but the mid-season rejigging to no obvious end is baffling. Is Colapinto an improvement? And does he need to be drafted in so fast? Logan Sarjeant (right) has lost his seat at Williams after being axed to be replaced by 21-year-old Argentine Franco Colapinto (left) The race for Adrian Newey’s signature Adrian
Continue readingX braced for Brazil ban as judge’s deadline passes
[ad_1] X, formerly known as Twitter, has said it expects to be blocked in Brazil after failing to meet a deadline to name a new legal representative for the company. The social media network closed its office in the country earlier this month, saying its representative had been threatened with arrest if she did not comply with orders it described as “censorship”. The months-long row began with Supreme Court Judge Alexandre de Moraes in April ordering the suspension of dozens of X accounts for allegedly spreading disinformation. X owner Elon Musk has threatened to reactivate the accounts, and has described Mr Moraes as a “tyrant” and a “dictator”. Justice Moraes gave X 24 hours to name a new legal representative or face suspension, with the deadline coming just after 20:00 local time (23:00 GMT) on Thursday. A ban would be expected to take some 12 hours to come into force. But in a post from one of its official accounts shortly after the deadline expired, X made clear that it had not complied with the order. “Soon, we expect Judge Alexandre de Moraes will order X to be shut down in Brazil – simply because we would not comply with his illegal orders to censor his political opponents,” the post said. “The fundamental issue at stake here is that Judge de Moraes demands we break Brazil’s own laws. We simply won’t do that.” X said it would not comply “in secret with illegal orders”, adding that it would publish the judge’s demands in the coming days “in the interests of transparency”. Justice Moraes had ordered that X accounts accused of spreading disinformation – many supporters of the former right-wing president Jair Bolsonaro – must be blocked while they are under investigation. He said the company’s legal representatives would be held liable if any accounts were reactivated. Justice Moraes gained prominence after his decisions to restrict social media platforms in the country. He is also investigating Mr Bolsonaro and his supporters for their roles in an alleged attempted coup d’état on 8 January last year. [ad_2] Source link
Continue reading