<?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 Travel – Health-HQ https://www.healthhq.guru Master Your Health Sat, 13 Aug 2022 14:10:08 +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 Travel – Health-HQ https://www.healthhq.guru 32 32 Stay Away from These Tourist Hacks in France https://www.healthhq.guru/uncategorized/stay-away-from-these-tourist-hacks-in-france/ https://www.healthhq.guru/uncategorized/stay-away-from-these-tourist-hacks-in-france/#respond Sat, 13 Aug 2022 14:01:38 +0000 http://www.healthhq.guru/uncategorized/stay-away-from-these-tourist-hacks-in-france/ France is a fantastic destination for a family holiday or for solo backpacking travels. However, it is also the main breeding ground for scammers looking to take advantage of the millions of tourists. Over the years, these fraudsters have developed several schemes to trick and rob people.

When visiting France, you may want to pay attention and extra care to avoid the following traps!

Château de Chambord is always crowded

France has a significant number of medieval castles that are filled with tacky designs and expensive artefacts. Visiting these old architectural marvels should be at the top of your must-see landmarks list when traveling through Europe.

However, some French castles like Château de Chambord are always filled with tourists. Because they do not impose a visitor limit, people get into the maximum capacity. This means that you and your friends will have difficulty seeing the art exhibitions or enjoying personal space.

Saint Tropez dries out your budget

You cannot talk about Saint Tropez without mentioning the overpriced restaurants, expensive cafes, and ridiculously high parking prices. If you plan to take your family to this glamorous seaside resort, you must have a substantial reserve of gold in your bank account.

Because it is the summer home of numerous celebrities and businesspeople, Saint Tropez practices high fees for everything except the air you breathe. Even looking for cheap restaurants in this area is difficult. More than that, if you get to date one of them, prepare to empty your wallet from the first cup of coffee you order.

Lastly, remember to avoid crowded areas where pick-pocketers “earn” their living. Your best choice is to leave all your valuables in the hotel’s safe and only bring along the strict essentials.

]]>
https://www.healthhq.guru/uncategorized/stay-away-from-these-tourist-hacks-in-france/feed/ 0
Tourist traps to avoid in France https://www.healthhq.guru/uncategorized/tourist-traps-to-avoid-in-france/ https://www.healthhq.guru/uncategorized/tourist-traps-to-avoid-in-france/#respond Sat, 13 Aug 2022 14:01:38 +0000 http://www.healthhq.guru/uncategorized/tourist-traps-to-avoid-in-france/ France is the country of love, good wine, sexy women, and delicious cheese. It is one of the most visited places on Earth, and tens of millions of people cross its borders yearly. Unfortunately, this abundance of visitors has attracted numerous scammers and ill-intended people that set up tourist traps at almost every street corner.

If you don’t want your vacation to finish in tears, you might want to avoid these tourist traps in France:

The Nice conundrum

The Cote d’Azur boasts a collection of gorgeous towns and sea resorts. One of them is Nice, a beautiful seaside town with a long history. If you visit this place, you might want to stay away from the old city center. Here, you are welcomed with crowded restaurants, busy fashion shops, and overpriced souvenirs.

Instead of treating your Parisian friend to an avalanche of noisy, troublesome merchants, you should take her to the lovely promenade by the sea. This place is also the home of talented painters. A quick portrait or funny caricature is a better gift than a souvenir from Nice manufactured in China.

Mont Saint-Michel looks better in pictures

We’ve all seen fabulous photos of the Mont Saint-Michel castle, which strays out into the sea on the Normandy coast. This medieval building rises above the waves to create a surrealistic image of a water-born fortress. This type of depiction attracts millions of people every year who expect to witness in person the same grandeur.

Unfortunately, you and your friends will be highly disappointed when you get there. The weather conditions are so bad in this region that the fortress is observable in clear daylight only a few days per year. Also, the road that stretches to the castle is overcrowded with souvenir shops and taverns that cheapen the experience.

]]>
https://www.healthhq.guru/uncategorized/tourist-traps-to-avoid-in-france/feed/ 0
Important Things to Know Before Moving to France https://www.healthhq.guru/uncategorized/important-things-to-know-before-moving-to-france/ https://www.healthhq.guru/uncategorized/important-things-to-know-before-moving-to-france/#respond Sat, 13 Aug 2022 14:01:38 +0000 http://www.healthhq.guru/uncategorized/important-things-to-know-before-moving-to-france/ France is the no.1 tourist destination in the world. However, it’s more than a touch-and-go place. It is a country where you can easily settle, build a family, and live a peaceful life. In fact, cities like Paris, Lyon, Bordeaux, and Strasbourg are among the top picks for expats when changing their homes.
If you want to move to France, you should know the following tips!
French cars are not that bad
France used to be an engineering power horse when it comes to automobiles. However, the past few decades have seen the car manufacturers in the country lose most of their excellent reputation to companies from other countries.
If you are an expat living in France, you have a great chance of driving good cars produced locally. Have your pick between a Peugeot, a Citroen, or a Renault vehicle. Your choice will surely earn the respect of your Parisian friends and French neighbors.
Immigration is more significant than it appears
France is a country that has struggled with newcomers for centuries. The nation is formed of numerous ethnicities and communities from various other countries and settled here. While some say it is not the ideal recipe for cultural heritage, others encourage immigration as a form of economic upheaval. In fact, this phenomenon adds to the versatility of several professions like escorts, entertainment girls, and teachers.
Living in Paris is not a fairy tale
Paris is a fantastic city if you visit it for a few days. However, it might become a bit too much for your lifestyle when you get to work and live there. Unless you have the pleasant company of a good Parisian friend, you risk succumbing to depression and anxiety.

]]>
https://www.healthhq.guru/uncategorized/important-things-to-know-before-moving-to-france/feed/ 0
The Truth About Living in France as an Expat https://www.healthhq.guru/uncategorized/the-truth-about-living-in-france-as-an-expat/ https://www.healthhq.guru/uncategorized/the-truth-about-living-in-france-as-an-expat/#respond Sat, 13 Aug 2022 14:01:38 +0000 http://www.healthhq.guru/uncategorized/the-truth-about-living-in-france-as-an-expat/ Moving to another country can be a challenging experience if you do not plan it well. Fortunately, a few countries ease your adaptation period through their local culture and abundant offerings. One of these promised lands is France – a country that welcomes people to live and work in different jobs, from hairdressers to military and from world-class chefs to wine experts.

Here are a few things experienced by expats that show the truth about living in France:

People are not as mean as they seem

French people have a terrible reputation for being arrogant and impolite. If you spend just a few days in France, you might encounter this type of people that will completely ruin your vacation. On the other hand, this kind of experience is possible in any country on the planet.

However, if you spend more than a few months in France, you will get to know plenty of decent people among the locals. It is enough to befriend a Parisian that will introduce you to her circles of friends and acquaintances. This way, you will soon see the myth of French arrogance fade away.

It is possible to find bad wine and cheap cheese

Many foreigners regard France as the land of wine and cheese, where none of these products have a sub-standard value. Again, if you only buy your stuff from the duty-free shops in the airports, you will not find lousy wine or cheap cheese.

Nevertheless, when you get to live in France for several years, you find that poor-quality wine and cheese are easy to find. The secret is to avoid them when you have guests in your home. Treating them to lousy drinks and foods will help you lose your hard-earned friends quite quickly.

]]>
https://www.healthhq.guru/uncategorized/the-truth-about-living-in-france-as-an-expat/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