Malacandra.me

Latest Posts

Becoming a Better WordPress Developer – One Project at a Time

Time is one of the best indicators of how far you’ve come in terms of being better at your job. But it seems like web design and development is a line of work that provides the most tangible evidence of progression. All you have to do is take a look back at an old project and the proof will be there, looking right at you.

In my own career, I go back to my days with static HTML websites. I can easily see the signs of improvement in the code – and particularly when it comes to how I accomplished various layouts (hint: table layouts were older).

But over my years of building themes for WordPress, I can also see how things have changed. Sure, the design trends have come and gone. Those are the most obvious types of progress. But there are other, more subtle, aspects of development that provide an even better picture of evolution.

Below are some lessons of WordPress development I’ve learned through experience. Most all of it has been learned the hard way. And, while I can’t guarantee that this is how others would do it, I hope that it can at least spark some thought about how and why we do things.

The Straightest Path Isn’t Always the Best

Rarely do we ever build a WordPress website that doesn’t include some sort of custom functionality. That is, after all, part of its appeal as a CMS. It can do just about anything we dream up.

Oftentimes, that means using plugins. We literally have an entire world of them at our fingertips. They help us do things like sell online, optimize our site for search engines and share content with others.

We often think of plugins as the straightest path to solving whatever challenge we’re facing. And, while a well-coded and properly maintained plugin can be exactly what we need, the decision to use one is often more serious than we may think.

The ease of installing and activating a WordPress plugin can give us a false sense of security. A few clicks provide instant functionality (and gratification). However, there are potential consequences each time we do it. Plugins can have an impact on virtually every aspect of a website – security, performance and compatibility to name just a few. Then, there is also the possibility of a plugin becoming abandoned and left to die out. That puts us right back to square one.

In many cases, the right code snippet can provide a much more efficient solution. It can save performance-degrading overhead and, importantly, is within your control. One of the most frustrating aspects of plugins is that you are essentially handing over part of your site’s well-being to a third party. If something breaks, you must rely on them to fix it. And even the best plugin developers out there will run into a hard-to-fix bug sometime. That leaves you to wait while a solution is found.

The bottom line here is that, while it’s fine to use plugins, think about the alternatives as well. There may be a better way to accomplish your goals.

The Straightest Path Isn't Always the Best

Find a Comfortable Starting Place

My first designs with WordPress were often the result of pulling apart whatever default theme that came with the software. For example, many of the sites I’m now in the process of redesigning were built with a thoroughly hacked version of the Twenty Ten theme. I didn’t even bother using a child theme, which of course is a big no-no. I just renamed the theme and went to work.

While this method worked, it was hardly efficient. I found myself having to rip the same things apart over and over for each new project. Default themes are actually meant to be used as a starting point, so it wasn’t quite as bad as it could have been with a fully-bloated theme. Still, there had to be a better way.

As time has gone on, I discovered the beauty of a WordPress starter theme. There are a number of ways you can go, from full-on frameworks to something a bit more barebones, like Underscores (my personal favorite solution).

What I love about Underscores is that, out of the box, it’s pretty much as unformatted as you can get. That means I don’t have to rip anything apart before I can start building. I’ve got my own customized version, complete with some basic responsive styles, to give me a healthy head start on design and development.

This also allows me to design prototypes knowing how it will apply to my starter theme. There aren’t nearly as many worries about how I can achieve a specific look or layout because I have built in ways to handle most anything. That doesn’t mean that there aren’t still some challenges, it just provides a nice blank canvas with which to work.

If you develop a lot of sites, you’ll be much further ahead if you set up your own starter theme. Include the scripts and layouts that you use most often. That will get you up and running with each project in no time.

Find a Comfortable Starting Place

Take the Time to Learn

Early on, one of the biggest mistakes I made with WordPress was that I didn’t put in the foundational work when it came to learning the right way to do things. In particular, I had very limited knowledge of PHP. While I knew enough to hack my way through things, not having a grasp of the fundamentals made everything more difficult than it should have been.

For instance, it seemed like every project had a point where development stalled while I tried to figure out how to make something work. Because I didn’t really understand things, I found myself just hunting for code snippets and hoping they’d do the trick. Oftentimes I found that I couldn’t even customize those snippets to fit my needs – all because of my incredibly scattered approach.

Finally, I did something about it. I took an online PHP course one summer and, all of the sudden, things began to make sense. I am nowhere near a master programmer (the next must-have plugin won’t be coming from me anytime soon), but this basic understanding of how things work has improved the development process dramatically.

I still get stuck from time-to-time, but those issues tend to get cleared up much more quickly than before. And, while I still need code snippets, I generally can make them work for my situation.

So, instead of hacking your way through building with WordPress, take the time to learn the skills you need to know. Having even a basic understanding will empower you to do more than you thought you could.

Take the Time to Learn

Tomorrow Will Always Be Better

Lastly, I think it’s worth pointing out that evolving into a better developer is what we are supposed to do. So often, it’s easy to be hard on yourself when you have to dig in and try to fix something you built years ago. The old, “Why did I do it this way?” is a lament that we all face sooner or later.

The key is to learn from what you’ve done. As time goes by, you’ll find that your knowledge is greater and your processes are leaner. The result is that you’ll improve – one project at a time.

comments

The Big Question

The Big Question

by digby



David Frum asks the question I think we should all be asking at this point:

To what extent does President Trump—to what extent do congressional Republicans—look to Russian interference to help their party in the 2018 cycle?

Most observers predict a grim year for the GOP in 2018. But the economy is strong, and selective tax cuts are strategically redistributing money from blue-state professionals to red-state parents. The Republican national committee commands a huge financial advantage over its Democratic counterpart. (Thing look more even at the level of the individual candidates.) A little extra help could make a big difference to Republican hopes—and to Trump’s political survival.

Nothing has been done in the past 15 months to prevent that help from flowing. You have to wonder whether the president does not privately welcome that help, as he publicly welcomed help from WikiLeaks in the summer of 2016.

Trump’s own tweets reveal that among the things he most fears is the prospect of Representative Adam Schiff gaining the gavel of the House Intelligence Committee from the clownish present chairman, Devin Nunes. How far would Trump go to stop a dreaded political opponent, inside the law and outside? How far has Donald Trump gone in the past?

Trump continues to insist that he and his campaign team did not collude with Russia in the 2016 election. We know that they were ready and eager to collude—that’s on the public record. (“If it’s what you say I love it especially later in the summer.”) The public does not yet know whether the collusion actually occurred, and if so, in what form and to what extent.

But in front of our very eyes we can observe that they are leaving the door open to Russian intervention on their behalf in the next election. You might call it collusion in advance—a dereliction of duty as grave as any since President Buchanan looked the other way as Southern state governments pillaged federal arsenals on the eve of the Civil War.


Yes they are. All of them. And I guess that a whole lot of Americans are fine with that.

This strikes me as one of the most astonishing developments in this whole story. I get that Trump is an imbecile who has no idea how politics are supposed to work. He learned everything he knows from watching TV. But other Republicans must know that it would have been so much better if they had at last pretended to be alarmed by this election interference and had put on a show to indicate that they were on top of the matter. But it really doesn't seem so. They're all obviously more than willing to fight any attempts to stop another round of interference because they seem to be very sure that they are the ones who will benefit. And they have recognized that they can literally say anything and deny everything and their voters will not challenge them.

They already cheat with their vote suppression efforts and lies about voter fraud. If foreigners want to help them win elections by pushing out propaganda and stealing their opponents' proprietary documents and private correspondence, what's the problem? It's all for a good cause, amirite?

comments

“Collusionistas!”

"Collusionistas!"

by digby


I'm going to guess that most of my readers don't watch Fox News. Why would you? It's a propaganda network. But I urge you to watch at least the first five minutes of Yesterday's Fox and Friends to get a sense of what the Republicans, including your president, listen to every day.


Geraldo: I'm holding my breath and waiting for the group I call the collusionistas to apologize to Donald Trump for a year of fabricated stories based on wishful thinking and really lazy research, they have slandered the president and you know I wonder now what Msnbc and CNN are going to do, are they going to have huge gaps in their programming now that this whole collusion myth has been exposed.I think they really do owe the president an apology.

Fox news host: But Geraldo, they say the the investigation is just going to keep going. When do we just stop this? We already know they started the investigation, no collusion. We now have, no collusion affirmed in the indictment, by the way confirmed by Dianne Feinstein and Clapper. So when is this gonna end?

Geraldo: That's an excellent question. Now what's of interest to me is that these 13 Russian who were indicted, there is no allegation that they were having anything to do with any knowing American. There were some unwitting Americans who were duped by the Riussians. So that evenue of investigation is at a dead end. So where does that particular one end?

He goes on to say that Manafort and Flynn have nothing to do with the president of the United States.

And then there's this, which the president clearly saw yesterday morning:

Geraldo: This distraction is worrying ... you wonder how many agents have been taken off the duty of investigating terror and domestic terror, and I submit to you that what happened at Parkland School was terror, how many of the good agents have been taken off to follow these political dead ends? ...

It goes on with more nonsense about "elitists" wanting Trump to be the Manchurian Candidate and it's time for the mainstream media nad the Democrats to admit they made a mistake. I urge you to watch a few minutes of it just to get a flavor of what we're up against.

This is what Trump is obsessively watching every day. It's the highest level of intellectual engagement he's capable of.

And it gets even worse:



This is what Trump's supporters in official Washington are sayiung and it's what his base believes.
comments

I hate to be the bearer of bad news, but Republicans aren’t going to do what we want them to do

I hate to be the bearer of bad news, but Republicans aren't going to do what we want them to do

by digby



This piece in the Washington Post lays out what happened last week when the Senate tried to pass a biapartisan immigration bill with a fix for the DREAM kids:

As much of the country was gripped Wednesday by horrific images from the mass shooting at a Florida high school, two dozen senior Trump administration officials worked frantically into the night to thwart what they considered a different national security threat.

The looming danger on the minds of the officials was a piece of legislation scheduled for a vote the next day in the Senate. It was designed to spare hundreds of thousands of young immigrants known as “dreamers” from deportation — but to the men and women huddled in a makeshift war room in a Department of Homeland Security facility, the measure would blow open U.S. borders to lawless intruders.

“We’re going to bury it,” one senior administration official told a reporter about 10:30  that evening.

The assault was relentless — a flurry of attacks on the bill from DHS officials and the Justice Department, and a veto threat from the White House — and hours later, the measure died on the Senate floor.

The Trump administration’s extraordinary 11th-hour strategy to sabotage the bill showed how, after weeks of intense bipartisan negotiations on Capitol Hill, it was the White House that emerged as a key obstacle preventing a deal to help the dreamers.

The episode reflected President Trump’s inability — or lack of desire — to cut a deal with his adversaries even when doing so could have yielded a signature domestic policy achievement and delivered the U.S.-Mexico border wall he repeatedly promised during the campaign.

Along the way, Trump demonstrated the sort of unpredictable behavior that has come to define his topsy-turvy tenure, frequently sending mixed signals that kept leaders in both parties guessing.

Trump told lawmakers last month he would sign any immigration bill that made it to his desk. At one point in the fall, to the chagrin of some in the GOP, Senate Minority Leader Charles E. Schumer (D-N.Y.) and House Minority Leader Nancy Pelosi (D-Calif.) thought they had a deal, giving Trump billions of dollars for the wall in exchange for a “dreamer” fix. Immigration advocates recalled that Trump, last year, had told the dreamers they could “rest easy.”

In the end, Trump remained loyal to restrictionist advisers and allies, who have pressed the president to be true to his hard-line rhetoric on the issue. And Democrats and some GOP centrists are asking whether Trump ever really wanted to reach a deal in the fall when he terminated the Obama-era Deferred Action for Childhood Arrivals program, placing in limbo the lives of nearly 700,000 young undocumented immigrants who were brought to the United States as children.


Uhm, no. He didn't give a flying fuck. He doesn't care about anything but himself. And heh ates anyone who looks like she came from a "shithole country" because he's a stone cold racist. Have we not figured that out yet?

The DREAM kids have organized, they have marched, they have protested for years. All the polling shows that a vast majority of the country wants them to be able to stay and have a path to become citizens.

But there is a group of anti-immigrant zealots who control the president and the congress and they have veto power. They need to be replaced. And s this demonstrates, so does the president.

I'm sorry to be cynical but that's where I am right now. This is a deep structural problem that's going to take years and years of hardcore movement building and electoral victories to change. I'm not in the mood for kumbaaya.

comments

Why do we assume his insane behavior is just a function of ego?

Why do we assume his insane behavior is just a function of ego?

by digby



In case you aren't on twitter, I thought you should know what has been on your president's mind this president's day week-end:


He was clearly very moved by his visit to the hospital in Florida. So moved that he blamed the FBI for the deaths of all those kids because they were investigating the Russian intervention.

And the rest of this bizarre series of rants...

This is a very sick man. Very sick. The narcissism and solipsism is more extreme than anything I've ever come across in my life. And I worked in Hollywood.

This tweetstorm has the character of a cornered animal fighting for his life. And yet the indictments that came down didn't implicate him. I know we all assume that it's just his ego at work, that he is so twisted and deranged that he cannot stop doing this because he thinks it taints his victory. He says that himself. So why do we believe it? He's a pathological liar.

Well, I assume it's because his narcissism is so obvious that it's believable that he would go to these lengths to defend his narrow victory.

But what if that's not it? What if he goes to these lengths because he's actually guilty? I certainly am not saying that he has a strategy. He's clearly incapable of that. What I'm saying is that his crazy reaction to the Russia investigation isn't necessarily attributable to his insane ego. It might just be attributable to the fact that he knows he did something very bad and he knows he's going to be caught.

It is not normal for a 71 year old man to behave this way, certainly not normal for a president. But there is no reason to assume that his abnormal behavior is simply a function of his narcissism. It might just as easily be a function of his guilt.

comments

Mine, mine, mine, mine by @BloggersRUs

Mine, mine, mine, mine

by Tom Sullivan

A gunman entered her high school on Valentine's Day and killed seventeen of her classmates. Wiping back tears, Marjory Stoneman Douglas High School student Emma Gonzales held back nothing else in challenging President Trump, national politicians, and the National Rifle Association in a powerful speech to an anti-gun rally in Fort Lauderdale, Florida on Saturday.

If there is one thing teenagers' eyes see better than adults', it is hypocrisy. Their tolerance for it is lower too.

Gonzales told the crowd:

In February of 2017, one year ago, President Trump repealed an Obama-era regulation that would have made it easier to block the sale of firearms to people with certain mental illnesses.

From the interactions that I had with the shooter before the shooting and from the information that I currently know about him, I don't really know if he was mentally ill. I wrote this before I heard what Delaney said. Delaney said he was diagnosed. I don't need a psychologist and I don't need to be a psychologist to know that repealing that regulation was a really dumb idea.

Republican Senator Chuck Grassley of Iowa was the sole sponsor on this bill that stops the FBI from performing background checks on people adjudicated to be mentally ill and now he's stating for the record, 'Well, it's a shame the FBI isn't doing background checks on these mentally ill people.' Well, duh. You took that opportunity away last year.

Grassley said after the Florida shootings, "We have not done a very good job of making sure that people that have mental reasons for not being able to handle a gun getting their name into the FBI files and we need to concentrate on that."

Watch her speech. Then watch it again.

In most reports on her speech, this early section gets left out:

I read something very powerful to me today. It was from the point of view of a teacher. And I quote: When adults tell me I have the right to own a gun, all I can hear is my right to own a gun outweighs your student's right to live. All I hear is mine, mine, mine, mine.
Contrast that with the comments of the conservative Australian rancher Jon Oliver spoke with in 2013. He did not want to part with his weapons when the government banned them after the Port Arthur massacre, "But ... I felt as if I had a bit of a duty to the rest of our society." [timestamp 3:32]

It is a duty too few American "patriots" feel to theirs.

Mine, mine, mine, mine.

* * * * * * * *

Request a copy of For The Win, my county-level election mechanics primer, at tom.bluecentury at gmail.

comments

Tell me why: A therapeutic mixtape   By Dennis Hartley @denofcinema5

Tell me why: A therapeutic mixtape

By Dennis Hartley



In a 2016 piece about the mass shooting at Orlando’s Pulse nightclub, I wrote:

But there is something about [Orlando] that screams “Last call for sane discourse and positive action!” on multiple fronts. This incident is akin to a perfect Hollywood pitch, writ large by fate and circumstance; incorporating nearly every sociopolitical causality that has been quantified and/or debated over by criminologists, psychologists, legal analysts, legislators, anti-gun activists, pro-gun activists, left-wingers, right-wingers, centrists, clerics, journalists and pundits in the wake of every such incident since Charles Whitman perched atop the clock tower at the University of Texas and picked off nearly 50 victims (14 dead and 32 wounded) over a 90-minute period. That incident occurred in 1966; 50 years ago this August. Not an auspicious golden anniversary for our country. 50 years of this madness. And it’s still not the appropriate time to discuss? What…too soon? 
All I can say is, if this “worst mass shooting in U.S. history” (which is saying a lot) isn’t the perfect catalyst for prompting meaningful public dialogue and positive action steps once and for all regarding homophobia, Islamophobia, domestic violence, the proliferation of hate crimes, legal assault weapons, universal background checks, mental health care (did I leave anything out?), then WTF will it take?
Well, that didn’t take. Which reminds me-remember what happened a year ago this month? Here’s a quick refresher (from the Washington Times-February 15th, 2017):
Congress on Wednesday approved the first gun rights bill of the new Republican-controlled Washington, voting to erase an Obama administration regulation that would have forced Social Security to scour its lists and report some of its beneficiaries to the firearms no-buy list. 
The Senate approved the bill on a 57-43 vote. The House cleared the legislation earlier this month. 
If President Trump signs the bill into law as expected, it will expunge a last-minute change by the Obama administration designed to add more mental health records to the national background check system that is meant to keep criminals and unstable people from obtaining weapons.
In case you missed it, President Trump did, in fact, sign the bill into law. As expected.

So how did that work out for us? Remember Vegas? Watched any news…this week?

You know what “they” say-we all have a breaking point. When it comes to this particular topic, I have to say, I think that I may have finally reached mine. I’ve written about this so many times, in the wake of so many horrible mass shootings, that I’ve lost count. I’m out of words. There are no Scrabble tiles left the bag, and I’m stuck with a “Q” and a “Z”. Game over. Oh waiter-check, please. The end. Finis. I have no mouth, and I must scream.

Something else “they” say...music soothes the savage beast. Not that this 10-song playlist that I have assembled will necessarily assuage the grief, provide the answers that we seek, or shed any new light on the subject-but sometimes, when words fail, music speaks.

As the late great Harry Chapin tells his audience in the clip I’ve included below: “Here’s a song that I could probably talk about for two weeks. But I’m not going to burden you, and hopefully the story and the words will tell it the way it should be.” What Harry said.


“Family Snapshot” – Peter Gabriel

“Friend of Mine” – Jonathan & Stephen Cohen (Columbine survivors)

“Guns Guns Guns” – The Guess Who

“I Don’t Like Mondays” – The Boomtown Rats

“Jeremy” – Pearl Jam

“Melt the Guns” – XTC

“Psycho Killer” – The Talking Heads

“Saturday Night Special” – Lynyrd Skynyrd

“Sniper” – Harry Chapin

“Ticking” – Elton John


Previous posts with related themes:


NRA Issues Statement on Latest Mass Shooting
Bang Bang, Shoot Shoot
America: A History of Violence
Defending Liberty!
Toddler Exercises His 2nd Amendment Rights
Small Popcorn, Medium Coke, and a Kevlar Vest, Please


More reviews at Den of Cinema
On Facebook
On Twitter

--Dennis Hartley


.

comments

The wingnuts subtly change their excuses in light of the indictments

The wingnuts subtly change their excuses in light of the indictments

by digby


Nice try. There are dozens on damning statements but none more damning than this one:

Trump said he spoke with Russian President Vladimir Putin and that he had assured Trump that there was no interference in the campaign.

"I asked him again," Trump told reporters on a flight to Hanoi. "You can only ask so many times... He said he absolutely did not meddle in our election. He did not do what they are saying he did. 
"I really believe that when he tells me that, he means it... I think he's very insulted, if you want to know the truth."

Come on. How about this?

That was just last September.  He's not talking about his own alleged involvement. He's saying the whole Facebook thing was a hoax.

This is utter nonsense. But then, when it comes to this White House, what isn't?

During the debates he was clear that he didn't believe there was any Russian hacking.

October 2016:

"But I notice, anytime anything wrong happens, they like to say the Russians are — she doesn't know if it's the Russians doing the hacking. Maybe there is no hacking. But they always blame Russia. And the reason they blame Russia because they think they're trying to tarnish me with Russia. I know nothing about Russia."

September 2016:
"I don't know if we know it was Russia who broke into the DNC. She keeps saying Russia, Russia, Russia. Maybe it was. It could also be China, it could be someone sitting on their bed that weighs 400 pounds."

He'd had national security briefings by this time. He knew. And he knew the government knew.

comments

QOTD: Bernie Sanders

QOTD: Bernie Sanders


by digby


People thinking that Senator Bernie Sanders was happy to receive help from the Russian government in 2016 are on the wrong track. Sanders is a man of the left who understands what the Putin government is really all about and unlike Donald Trump, it's not anything that he admires or supports.

This quote
from his foreign policy speech last September is something I would hope everyone from the center to the far left could agree upon. If we don't, we are going to have even bigger problems than we already have:

Inequality, corruption, oligarchy and authoritarianism are inseparable. They must be understood as part of the same system, and fought in the same way. Around the world we have witnessed the rise of demagogues who once in power use their positions to loot the state of its resources. These kleptocrats, like Putin in Russia, use divisiveness and abuse as a tool for enriching themselves and those loyal to them.

Indeed. And it's happening all over the world. Our own demagogue is an f-ing moron so he's not quite as efficient as some of them but a little tutoring from his pals in the Party and maybe a few tips from his foreign despot friends and who knows? His pals in the congress are certainly getting the looting part of the job done.

People need to open their eyes about this.

comments

Oh my. Kushner requests more top secret intelligence than anyone else in the White House

Oh my. Kushner requests more top secret intelligence than anyone else in the White House

by digby


And he doesn't have a security clearance:

He holds a broad range of responsibilities, from overseeing peace efforts in the Middle East to improving the efficiency of the federal government. And he is the administration’s interlocutor with key allies, including China and Saudi Arabia, where he has developed a personal relationship with the young crown prince, Mohammed bin Salman.

Kushner has been present at meetings with the president where classified information was discussed and has access to the President’s Daily Brief, a digest of intelligence updates based on information from spies, satellites, and surveillance technology, according to people with knowledge of his access.

And apart from staff on the National Security Council, he issues more requests for information to the intelligence community than any White House employee, according to a person with knowledge of the situation, who spoke on the condition of anonymity to describe private discussions.

Experts said it is rare to have such a high level of interim security clearance for such a long period of time. It is particularly striking access for someone like Kushner, who has never served in government and has a complex history of financial transactions, business ownership and contacts and dealings with foreigners.


Oh, by the way, he and his family are drowning in debt, about to go under.

Not that this would be any kind of motivation to, oh, provide a little info to some people who might help him with that problem.

Kushner is a serious national security threat. We don't know if he is actually doing anything untoward with all that intelligence. Maybe he's just using it for the cause of middle east peace.
But this isn't a risk anyone but Donald Trump would be willing to take.

I doubt anything will change. Kushner doesn't seem to have used a personal server for any of his non-classified correspondence.

comments

 1 2 3 >  Last ›