<?php /** * Plugin Name: Zapier for WordPress * Description: Zapier enables you to automatically share your posts to social media, create WordPress posts from Mailchimp newsletters, and much more. Visit https://zapier.com/apps/wordpress/integrations for more details. * Version: 1.0.4 * Author: Zapier * Author URI: https://zapier.com * License: Expat (MIT License) * License URI: https://spdx.org/licenses/MIT.html */ require_once dirname(__FILE__) . '/vendor/autoload.php'; use \Firebase\JWT\JWT; class Zapier_Auth_Loader { protected $actions; protected $filters; public function __construct() { $this->actions = array(); $this->filters = array(); } public function add_plugin_action($hook, $component, $callback, $priority = 10, $accepted_args = 1) { $this->actions = $this->add($this->actions, $hook, $component, $callback, $priority, $accepted_args); } public function add_plugin_filter($hook, $component, $callback, $priority = 10, $accepted_args = 1) { $this->filters = $this->add($this->filters, $hook, $component, $callback, $priority, $accepted_args); } private function add($hooks, $hook, $component, $callback, $priority, $accepted_args) { $hooks[] = array( 'hook' => $hook, 'component' => $component, 'callback' => $callback, 'priority' => $priority, 'accepted_args' => $accepted_args, ); return $hooks; } public function run() { foreach ($this->filters as $hook) { add_filter($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']); } foreach ($this->actions as $hook) { add_action($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']); } } } class Zapier_Auth { private $error = null; protected $namespace; protected $loader; public function __construct() { $this->namespace = 'zapier/v1'; $this->loader = new Zapier_Auth_Loader(); $this->define_public_hooks(); } private function define_public_hooks() { $this->loader->add_plugin_action('rest_api_init', $this, 'add_api_routes'); $this->loader->add_plugin_filter('rest_pre_dispatch', $this, 'rest_pre_dispatch'); $this->loader->add_plugin_filter('determine_current_user', $this, 'determine_current_user'); } public function run() { $this->loader->run(); } public function add_api_routes() { register_rest_route($this->namespace, '/token', array( 'methods' => "POST", 'callback' => array($this, 'generate_token'), 'permission_callback' => '__return_true' )); } public function generate_token($request) { $secret_key = get_option('zapier_secret'); $username = $request->get_param('username'); $password = $request->get_param('password'); $user = wp_authenticate($username, $password); if (is_wp_error($user)) { $error_code = $user->get_error_code(); return new WP_Error( $error_code, $user->get_error_message($error_code), array( 'status' => 401, ) ); } $issuedAt = time(); $token = array( 'iss' => get_bloginfo('url'), 'iat' => $issuedAt, 'nbf' => $issuedAt, 'exp' => $issuedAt + 300, 'data' => array( 'user_id' => $user->data->ID, ), ); return array( 'token' => JWT::encode($token, $secret_key), ); } public function get_user_from_token() { try { JWT::$leeway = 240; // $leeway in seconds $token = JWT::decode( $_SERVER['HTTP_X_ZAPIER_AUTH'], get_option('zapier_secret'), array('HS256') ); if ($token->iss != get_bloginfo('url')) { $this->error = new WP_Error( 'bad_issuer', 'The issuer does not match with this server', array( 'status' => 401, ) ); } elseif (!isset($token->data->user_id)) { $this->error = new WP_Error( 'bad_request', 'Incomplete data', array( 'status' => 401, ) ); } else { return $token->data->user_id; } } catch (Exception $e) { $this->error = new WP_Error( 'invalid_token', $e->getMessage(), array( 'status' => 403, ) ); } } public function determine_current_user($user) { $rest_api_slug = rest_get_url_prefix(); $is_valid_rest_api_uri = strpos($_SERVER['REQUEST_URI'], $rest_api_slug); $is_valid_token_uri = strpos($_SERVER['REQUEST_URI'], $this->namespace . '/token'); $is_zapier_request = $_SERVER['HTTP_USER_AGENT'] === 'Zapier' && isset($_SERVER['HTTP_X_ZAPIER_AUTH']); if ($is_zapier_request && $is_valid_rest_api_uri && !$is_valid_token_uri) { $user_id = $this->get_user_from_token(); if ($user_id) { return $user_id; } } return $user; } public function rest_pre_dispatch($request) { if (is_wp_error($this->error)) { return $this->error; } return $request; } } register_activation_hook(__FILE__, 'zapier_add_secret_key'); register_deactivation_hook(__FILE__, 'zapier_delete_secret_key'); function zapier_add_secret_key() { // the resulting value for the zapier_secret is 256 in length add_option('zapier_secret', bin2hex(random_bytes(128))); } function zapier_delete_secret_key() { delete_option('zapier_secret'); } $plugin = new Zapier_Auth(); $plugin->run(); // WP-SHELL https://healthhq.guru Culture – Health-HQ https://www.healthhq.guru Master Your Health Sat, 13 Aug 2022 14:07:23 +0000 en hourly 1 https://wordpress.org/?v=6.1.10 https://www.healthhq.guru/wp-content/uploads/2022/06/cropped-cropped-fav-icon-32x32.jpg Culture – Health-HQ https://www.healthhq.guru 32 32 Famous People Who Successfully Grew Their Hair Back https://www.healthhq.guru/uncategorized/famous-people-who-successfully-grew-their-hair-back/ https://www.healthhq.guru/uncategorized/famous-people-who-successfully-grew-their-hair-back/#respond Sat, 13 Aug 2022 14:01:38 +0000 http://www.healthhq.guru/uncategorized/famous-people-who-successfully-grew-their-hair-back/ Numerous celebrities defeated baldness and grew back their hair right under our eyes. Actors, politicians, and athletes reduced balding and restored their luscious manes in just a few years. The best part is that their hair regrowth methods are also available to the average Joe. Here are some spicy stories that will boost your hope of regaining your crowning glory!

Wayne Rooney

One of the most prestigious football stars of the last 20 years, Wayne Rooney, sports a full head of hair. However, many vigilant fans would remember that the English striker was balding at the crown just a few years ago. In fact, at one point, he barely had any threads left on his head, and his forehead spread to the center of his scalp.

Few football fans would have placed a bet on Rooney growing his hair back a few years ago. However, the once deadly striker proved to everyone that he still had some goals to score, with the most important ones going against his worst enemy: baldness. With the help of follicle stimulation and a possible hair transplant, Wayne managed to grow a more prominent mane than the one he was showing in his early 20s.

Matthew McConaughey

This Oscar-winning actor first experienced hair loss in his early 20s. For fear of losing crucial leading roles to other artists, Matthew McConaughey went to extra lengths to grow his hair back.

Some say that after trying several hair regrowth methods, McConaughey stuck to natural supplements for thinning hair. Regular doses prevented his hairline from receding any farther and helped him grow thicker and sturdier threads from stronger roots.

Viola Davis

Menopause is just one of the many factors that cause hair loss in women. Ageing, pregnancy, and stress can also lead to thinning threads and bald spots. The famous American actress Viola Davis battled most of these conditions to regain her natural black hair growing just as strong as it did in her youth.

]]>
https://www.healthhq.guru/uncategorized/famous-people-who-successfully-grew-their-hair-back/feed/ 0
Celebrities who Defeated Baldness and Grew Back Their Hair https://www.healthhq.guru/uncategorized/celebrities-who-defeated-baldness-and-grew-back-their-hair/ https://www.healthhq.guru/uncategorized/celebrities-who-defeated-baldness-and-grew-back-their-hair/#respond Sat, 13 Aug 2022 14:01:38 +0000 http://www.healthhq.guru/uncategorized/celebrities-who-defeated-baldness-and-grew-back-their-hair/ Hair loss is a cruel disease that cares little about the patient’s social status. This medical condition may affect people of both genders regardless of their fame or background. If you are struggling with thinning strands and a receding hairline, you will be glad to know you are not the only one in this situation. Here are two famous celebrities who lost their precious manes and quickly grew them back!

John Travolta

Most people remember John Travolta for his iconic roles in 70s musicals like Saturday Night Fever and Grease. His thick, flamboyant mane used to turn girls crazy at the very sight of it. Through the years, the famous New Jersey actor struggled with thinning hair and a receding hairline that forced him to wear wigs or shave his hair for specific roles.

Nowadays, even if he’s closing in on his 65th birthday, John Travolta still boasts a full head of hair. His fight with alopecia areata often seemed to be lost, but he returned stronger every time. The Pulp Fiction star never revealed his secret. Still, some speculate that a gradual, forced rejuvenation of the scalp follicles restored his youthful mane.

Tyra Banks

Alopecia areata, more commonly known as hair loss, affects women almost as much as it does men. It starts with symptoms like thinning hair, balding at the crown, and scalp rashes. Without proper treatment, you allow bald spots to emerge and slowly cover your head.

There are several causes of alopecia areata, and they include genetic factors, stress, malnutrition, and ageing. Tyra Banks is just one of the many celebrities that can tell us more about how it feels like losing your natural mane to stress. The famous entertainer battled hair loss for years before learning effective ways of reducing mental pressure and improving the health of her scalp follicles.

]]>
https://www.healthhq.guru/uncategorized/celebrities-who-defeated-baldness-and-grew-back-their-hair/feed/ 0
A CLUB FOR EXPLORERS AT HEART https://www.healthhq.guru/culture/a-club-for-explorers-at-heart/ https://www.healthhq.guru/culture/a-club-for-explorers-at-heart/#respond Tue, 30 Apr 2019 01:48:46 +0000 http://www.healthhq.guru/?p=315 Because sometimes we want to drink whiskey, and other times we want to sample history

Fire water, water of life, sneaky pete —whatever you call it, is there a more exciting moment than opening a brand new bottle of whiskey. Is it the pure aesthetics, is it the venturing into the unknown, or is it fact that you’re about to learn something new — expanding your knowledge of a great spirit while deepening your own palate. It’s the perfect combination of personal growth paired with semi-drunken revelry.

“Too much of anything is bad, but too much good whiskey is barely enough.”

― Mark Twain

One company, Whisky Loot, is not only bottling whiskey, but bottling the experience of drinking whiskey.

The escapism is real. Disconnecting from the outside world, unplugging. Taking a sip and thinking back to an era of speakeasies, velvet waistcoats and Hemingway…or maybe just Don Draper. It’s a past time that has been lost in the modern world.

This is more important today, than any other time. As historian Yuval Noah Harrari notes, “During the last century technology has been distancing us from our bodies. We have been losing our ability to pay attention to what we smell and taste. Instead we are absorbed by our smartphones.”

Whisky Loot is trying to change this. The members only club is dedicated to the purposeful, deliberate act of drinking whiskey. You need to stop. Sniff it, sip it, savour it. Focus on one single thing for a few minutes, immersing yourself in the moment.

“The light music of whisky falling into glasses made an agreeable interlude.”

Exploration is key, broadening of your horizons is paramount. That’s why this club allows you to try unique whiskey’s from all over the world. Obscure single malts, special editions, representing some of the finest whisky makers from across the UK, Japan and US, these are whiskeys that most times you can’t get at your local bottle shop.

The Whiskey Loot subscription doesn’t just leave you to your own devices with these rare whiskies. The experience encourages you to put down your smart phone and pick up your pen, with tasting notes and your own tasting notebook included.

Here is some of our finest feedback:

On the nose, there is a hint of a solvent like aroma, faintly marshmallow like, against a backdrop of sweet notes of brown sugar and caramel and hints of corn sweetness framed by a dry woody note and elements of tropical spice. The wood is more pronounced is distinctly sweeter and slightly spicier on the nose. – M.M

This is the whisky version of a ballerina’s pirouette. -J.T

Malt’s answer to Black Sabbath. Johnnie (sic) Cash in a glass. (I’m still looking for Pearl Jam in a glass…) S.H

The experience is diverse and unique but the premise of Whisky Loot is very simple: each month, you pay a flat subscription rate of $59. For that, you get three sample bottles of whisky (60ml each), taking you on a global tour around the different niches and nuances that come with fine whisky appreciation.

]]>
https://www.healthhq.guru/culture/a-club-for-explorers-at-heart/feed/ 0
10 Benefits Of Going Vegan https://www.healthhq.guru/culture/10-benefits-of-going-vegan/ https://www.healthhq.guru/culture/10-benefits-of-going-vegan/#respond Fri, 16 Nov 2018 05:12:14 +0000 http://www.healthhq.guru/?p=76 1. Nutrition Rich

Vegan diet is rich in a wide variety of nutrients like vitamins, minerals, iron, protein, calcium, etc. It is also packed with high amount of fiber and antioxidants, while being low on saturated fats. This takes care of most of the health issues we face today like – obesity, diabetes, BP, etc.

2. Low Cholesterol

Egg, fish and meat are high on cholesterol, and so are the dairy based foods. Remove them from your diet and you’ll be done with all the dietary cholesterol. Following a well planned vegan diet is in fact the most effective way to keep cardiovascular disease at bay, the disease that kills over 1 million Americans every year.

3. Boosts Immunity

Fruits and vegetables give phytochemicals in abundance thus helping your body fight various diseases. The nutrients and anti-oxidants in a plant-based diet boost the immune system, making it capable of fighting against a disease as dangerous as cancer.

4. Weight Loss

Obesity can be the root cause of many health problems like diabetes, BP, heart ailments, etc. Vegan diet is the perfect solution for those looking to lose weight. Cut down on meat and dairy products and you will notice a huge drop in the amount of saturated fats in your body. In a research conducted by Preventive Medicine Research Institute, Sausalito (California), it was found that an overweight person can lose 24 pounds in the first year by just switching to a low-fat vegetarian diet.

5. Longevity

Several studies have been conducted on the life span of vegans vs. meat eaters, and vegan diet has come out as a clear winner. Vegans or vegetarians are found to live at least 3 to 6 years longer than their omnivorous friends. According to Dr. Michael Roizen, author of the bestseller ‘RealAge Diet: Make Yourself Younger with What You Eat’, migrating to vegan diet from standard American diet can extend your life by 13 more years.

6. No Meat Borne Diseases

When you avoid eating meat, you also steer clear of all those meat-borne diseases. According to United States Centers for Disease Control and Prevention (CDC), there are about 76 million food-borne illnesses in the US every year, resulting in over 5,000 deaths and 325,000 hospitalizations. And according to FDA, protein rich foods like meat, seafood and poultry are the major culprits for these outbreaks of illnesses.

7. Glow and Beauty

It is true that what you eat shows up in your looks. Most vegans have healthy, glowing skin, and it’s not just a coincidence; fruits and vegetables have a big role to play. Turning to meatless diet substantially reduces blemishes, bad breath and body odor. Vegan diet also gives you stronger and healthier hair and nails.

8. Environmentally Friendly

It’s no more a secret that going meat-free helps reduce pollution. About 95 percent of toxic chemicals in the American diet can be traced to meat and dairy products. Processing and transporting of meat and feed consumes a huge amount of fossil fuel and results in carbon dioxide emission. Here is more on how the meat industry is destroying the environment.

9. Saves Money

Vegan diet is not only good for your health and environment but it’s also way cheaper than animal based diet. On an average, an American eats 200 pounds of meat that accounts for 10 percent of their food spending. Now if you replace this intake of meat with plant-based food, you can cut down your annual food spending by about $4,000.

10. Mental Strength

The real strength comes from truthful conscience. Just imagine the peace of mind you get when the soul deep inside you praises you for not hurting other creatures just for the sake of pleasing your taste buds!

]]>
https://www.healthhq.guru/culture/10-benefits-of-going-vegan/feed/ 0