Logging another one of my “weird wordpress problems” here.
We use a plugin called Buddypress Private Checklist to offer wedding to-do lists to our members on the Offbeat Bride Tribe. It was written many years ago by our old developer, and I’ve been vaguely maintaining it in our open source plugin repo on git. But it was a hack when it was written (old dev’s words, not mine!) and we’ve grown a lot over the years. It’s in need of a major upgrade, and the first item on my docket was the fact that it takes forever to load the initial default tasks into a to-do list.
The initial task loader takes a CSV full of default tasks and inserts them as posts into the Worpdress database. We have 124 tasks and it was taking five minutes. I expect a loop of 124 inserts to be a little slow, but five minutes is insane.
The posts, which are a custom post type, also use custom taxonomies to organize them. When I disabled the taxonomy inserts, done with wp_set_object_terms()
, everything ran quickly. When I tried the plugin on a fresh install it ran quickly even with the taxonomy information. Disabling all plugins and going to the default theme didn’t change anything. I finally put together a test page that just looped through a bunch of post and taxonomy inserts, and watched it with Query Monitor.
After every new taxonomy term is inserted, wordpress runs wp_update_term_count()
. On something the size of a personal blog this is not a big deal. On a community with 40,000 posts and 900 tags, this takes maybe half a second. Doing that 124 times takes forever. Thankfully there is a way to disable this excessive recounting, wp_defer_term_counting()
.
function insert_many_posts(){ wp_defer_term_counting(true); $tasks = get_default_tasks(); for ($tasks as $task){ $post = array( 'post_title' => $task[content], 'post_author' => $current_user->ID, 'post_content' => '', 'post_type' => 'bpc_default_task', 'post_status' => 'publish' ); $task_id = wp_insert_post( $post ); if ( $task[category] ) //Make sure we're passing an int as the term so it isn't mistaken for a slug wp_set_object_terms( $task_id, array( intval( $category ) ), 'bpc_category' ); } }
Now the whole loop takes about 10 seconds. Hooray!
Withdraw cash how much does ivf drugs cost On the morning of February 8, 2012, CNOOC chairman Wang Yilin met with Canadian Natural Resources Minister Joe Oliver, who was in Harper’s delegation, at CNOOC’s oil barrel-shaped headquarters. Wang expressed interest in expanding CNOOC’s footprint in Canada’s oil and gas industry, and Oliver welcomed the idea, according to CNOOC officials.
I’m on holiday eagle grove pharmacy eagle grove iowa “The rules say you can’t hit high so I went low and I’m sorry that happened,” Swearinger said. “I would think you’d rather have more concussions than leg injuries. Leg injury, you can’t come back from that. A concussion, you be back in a couple of weeks.”
Could I take your name and number, please? parkinsonism and acute fluoxetine intoxication The factory is projected to employ 6,500 people — Nevada residents and veterans will get priority in hiring — and pay an average of $25 an hour
I love the theatre buy indomethacin suppositories Tension between Western powers and Iran over its disputednuclear programme could ease, given progress in talks this week,although it could be some time before sanctions against Tehranare lifted and more of its crude flows into the market.
Why did you come to ? medis.lt kretinga I give you dumb $$, you let me dump unwanted, untested drugs and vaccines, what a good deal ! The practice was as immoral as the drugs themselves. Who cares if these GSK Chinese execs were trained with ethics or do business by hook or crook.
Best Site Good Work nuevopharmacy.com “It shows that both Cuba and North Korea are quite isolated and are seeking some solace in each other’s commercial and diplomatic embraces. They have few alternatives and they don’t have any hard cash,” he said.
Where do you study? where can nizoral be purchased Goodell and the Ravens had seen the first tape of Rice dragging Palmer unconscious out of the elevator and they knew Rice had committed an act of domestic violence
A few months frank rich massthetic muscles Norwegian Air grounded its 787s several times, citing problems with brakes, hydraulic pumps and power. On September 23, the carrier said one Dreamliner was beset with problems in the oxygen supply to the cockpit. A problem with a valve on the airline’s second 787 was repaired around the same time, but only after delaying a flight from Oslo to New York.
I do some voluntary work us-overnight-pharmacy-usa.com Kansas City officials havent always misled the public when it comes to spending a special source of revenue called the use tax. But the kind of behavior that undermines credibility has happened twice in the last decade, and thats twice too often.
Do you know the address? medibiosense.com Recent economic data has shown that the labor market is strengthening, though he is “somewhat concerned” about part-time and temporary jobs pushing up overall job gains. He also characterized recent economic growth as âlackluster.â
Will I get paid for overtime? edremedies.ca “It is not a statistical exercise to identify poor performers. Rather it is an exercise to provide information on activity and outcomes, to focus minds on improving results and to assure the public that the NHS offers high quality surgery.
I can’t hear you very well success rice printable coupon Loewe, which is 28 percent-owned by Japan’s Sharp,would in turn offer Hisense its distribution network in westernEurope and would exclusively distribute Hisense in the Austriantest market for new Ultra-HD technology, the statement said.
Good crew it’s cool 🙂 theartofmeditation.org/thestillnesschallenge I found out from senior students in my department about a 20-point question that always showed up on the professor’s first exam on this one obscure bacterium that the professor mentioned as a side-note during one class. The professor had done his doctoral dissertation on this bacterium 30 years ago and somehow it always made its way into his exams.
I never went to university progene untuk jerawat The NVIDIA Shield is the latest and greatest mobile gaming device around, and the guys over at iFixit just tore the handheld to shreds. Tastefully, of course. If you wanted to see all of the innards of the ultra powerful device, you now can!
Could you give me some smaller notes? aldara crema precio mexico Christie’s advisers say he has tried to make the best of a very bad situation
I’m doing a masters in law precio allopurinol gador
“It must go on until our criminal justice system can assure that all are treated equally and fairly in the eyes of the law and it must go on until every action that we take reflects our values and that which is best about us. It must go on until those who are now living and generations yet to be born can be assured the rights and the opportunities that have been too long denied to too many.”
I’m sorry, he’s methylprednisolone 10mg As a result, the investing public may check databases such as the Financial Industry Regulatory Authority’s BrokerCheck website and still get an incomplete picture about questionable sales practices by brokers and firms, said Scott Ilgenfritz, PIABA’s president.
good material thanks mymedicalinfos.com Israel has largely stayed on the sidelines of Syria’s civil war, a two-and-a-half-year conflict that pits the Iranian-allied Assad government against rebels who include Islamist militants deeply hostile toward the Jewish state.
I’d like to open an account preco yasmin portugal Rebecca’s mother, speaking with a local TV reporter, added, “I don’t know what I’m supposed to do next. I just lost my world. … Don’t ignore your kids if they seem fine – still check on them, because you don’t know what’s going on with them.”
Which university are you at? kybella uk Finally, Obama devastatingly exposed how self-defense laws like those in Florida, permitting the use of deadly force even if someone has the opportunity to retreat from a confrontation, set the stage for violence.
It’s funny goodluck nexium vs prilosec for gerd Copyright 2013 Catholic Online. All materials contained on this site, whether written, audible or visual are the exclusive property of Catholic Online and are protected under U.S. and International copyright laws, © Copyright 2013 Catholic Online. Any unauthorized use, without prior written consent of Catholic Online is strictly forbidden and prohibited.
Do you know each other? compounding shop pharmacy inc The state oil company Egyptian General Petroleum (EGPC) hasbeen struggling to buy fuel since Egypt’s 2011 revolution,particularly since the start of this year, when funding problemsstopped it buying crude oil on the open market.
Do you play any instruments? meaning of enzyte It was Navalny who first called the dominant United Russia party “the party of crooks and thieves,” a phrase that became a rallying cry for the nascent opposition to Russia’s leader, Vladimir Putin.
I’d like to apply for this job plaquenil for rheumatoid arthritis Instead it’s now their responsibility to deal with the headaches that come with his return to baseball, and since he’s here they might as well try to do all they can to get something out of him.
How much will it cost to send this letter to ? best drugs for osteomyelitis The first International Atomic Energy Agency (IAEA)ministerial conference since the crisis at Japan’s FukushimaDaiichi plant shocked the industry just two years ago clearlyreflected the bullish outlook of its Russian hosts.
Whereabouts in are you from? order cheap palmettoplex The U.S. Embassy in Cairo confirmed that an American citizen held prisoner in the Suez Canal city of Ismailia died from an apparent suicide and that it was in contact with Egyptian authorities. It had no further comment.
How many are there in a book? buy famciclovir online australia Apollo began a cost-cutting drive last October to offsetdeclining revenue as students stayed away. The company shut 25campuses, cut jobs and closed half of its University of Phoenixlearning centers.
Pleased to meet you lumonol pill review Fairfax, which has a market value of about $9 billion, became the company’s largest shareholder just last year, topping Mike Lazaridis, BlackBerry’s co-founder and former co-chief executive, who has a 5.7 percent stake. BlackBerry’s other former co-chief executive Jim Balsillie disclosed in February he had sold his remaining shares in the company.
This is your employment contract kamagra costa rica Energy UK, the trade body representing the six largest energy firms, said it would “freeze the money to build and renew power stations, freeze the jobs and livelihoods of the 600,000-plus people dependent on the energy industry and make the prospect of energy shortages a reality, pushing up the prices for everyone.”
I’d like to order some foreign currency manforce tablet reviews Workers at Cooperâs China joint venture have been on strike against the deal, and its partner there filed a lawsuit to stop the transaction. Workers have refused to make Cooper-branded tires and have stopped providing the joint ventureâs operational and financial information to Cooper.
I stay at home and look after the children trifecta andro kit uk
An offer from a Chinese company could upset the Canadiangovernment, which vets foreign takeovers to ensure they are inthe national interest and do not threaten national security. Industry Minister James Moore declined comment.
Thanks for calling ou acheter une carte sim mobicarte “If the government gets to essentially burn down your house because it thinks you’re engaging in illegal activity and then hide the fact by pretending there was an arsonist around at some point, it’s not a lawful situation,” she said. “There’s a fundamental thing that’s being lost here for an allegedly self-governing country.” ®
I’m not sure dapoxetine tablets spc According to Maine Department of Environmental Protection figures obtained by Reuters, revenues of the Maine Coastal and Inland Surface Oil Clean-up Fund have dropped from $6.7 million in 2003 to $3.7 million in 2012.
Could you tell me the dialing code for ? healthbeginswithmom.com The U.S. central bank has held interest rates near zerosince 2008 and has tripled its balance sheet to roughly $3.7trillion. Over the last year, it has been pumping $85 billioninto the U.S. financial system each month through bondpurchases.
Three years transparentpharmacy.net Separately, Siemens’s compliance chief Peter Solmssen willquit the management board and his post won’t be filled as thecompany further slims down its executive panel, WirtschaftsWochereported on Saturday. Siemens declined to comment.
Enter your PIN vitapearl manufacturer coupon “There are a bunch of countries that you can’t treat likeChina because they have democratic systems and they abide by therule of law, but they have speech restrictions that we wouldfind objectionable,” said Andrew McLaughlin, a former directorof global public policy at Google Inc and White Housetechnology official who is now chief executive of news websiteDigg. “Those are the issues where the rubber hits the road onfree speech.”
Can I take your number? atomic road pharmacy haatso According to CEO statement to the Financial Times newspaper, new technology would be capable of working with a combination of 90% control with vehicle’s computer system, and 10% with the car owner. But completely self-governing cars would take longer time to develop. He also added in his comment the self-driving car would be manufacture on Tesla’s own technology, and not that of another company.
I didn’t go to university what is ciprofloxacin used for chlamydia China denies being behind hacking attacks on other nations and insists it is a major victim of cyber attacks, including from the United States – an argument that Beijing sees as strengthened by revelations last month from a former National Security Agency contractor, Edward Snowden, about top-secret U.S. electronic surveillance programs.
We’re at university together vialafil krakow The MP had been sitting with a crowd of protesters outside the entrance to Cuadrilla’s Balcombe site for most of the day when she was marched away by officers and put into a waiting police van. Protesters also claimed that Ms Lucas’s son had been arrested. Sussex Police said protesters had been arrested as officers moved in to clear a large group of people in front of an emergency access to the site. More than 400 officers have been deployed on the operation at Balcombe, with support from 10 other UK forces.
Could you ask him to call me? laminine ingredients list The strength of demand for the Model S has surprised industry experts, investors and analysts. Limited driving ranges, high prices and relatively spartan interiors have hobbled demand made by other car makers like Nissan Motor Co Ltd and General Motors Corp.
I live in London erexin v mega opinie Just five funds made money in both those years, and they are shown in the table below.
I work with computers compare emeals plans So while the Rockies may well be motivated to trade Gonzalez, who is guaranteed $63.5 million over the next four years, or Tulowitzki, who has $130 million coming over the next five years, it seems the Mets would have to get creative if they want to deal for either player.
What’s the interest rate on this account? 8fit berlin Three of Kittel's team-mates are with him and they are putting the hammer down on the front of their bunch – they are tantalisingly close to getting back to the peloton which contains Cavendish, Greipel and Sagan.
Insufficient funds nootropil bodybuilding
“Intense competition for promotion places has pushed the majority of Championship and League One clubs into the red,” said Trevor Birch of accountancy firm BDO LLP, who commissioned the survey.
A book of First Class stamps nutrex glutamine drive black price in india “There’s not a lot of money is global health for statistical monitoring systems,” Nutt said. “It is hard to find funders for such a longer term, infrastructure driven government service. It’s not as exciting as donating money for, say, vaccines, where you see the benefit of your efforts with each child vaccinated.”
I never went to university ondansetron webmd
He usually gets up around midday and works short hours. “I can’t concentrate for more than three hours. So I might work for maybe one and half hours a day. But it will still work in my head afterwards,” he said.
I’d like to open a personal account titan-healthcare.com review
He is accused of two counts of conspiring with others to intercept communications in their transmission, one of conspiracy to commit misconduct in public office and one of perverting the course of justice.
I was made redundant two months ago valproic acid depakote medicinenet Whether it’s $5 or $50, they’re comfortable spending their thresholdlimit without thinking.
It’s a bad line quality care pharmacy hours “If we can say 'Yes, Labour has learned, and Labour is on your side' then this scheme will work. But if our people – our members – are unclear as to the answer then no amount of persuading will get them to sign up.”
I was born in Australia but grew up in England 30 mg propranolol Google Glass is the first attempt to put all the data your laptop or smartphone holds right before your eyes. The device appears to be a 25 inch screen 8 feet away from you, placed at the top right corner of your display. You’ll be able to control it using a touchpad on the arm of the frame and voice control.