<?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 medicare – Health-HQ https://www.healthhq.guru Master Your Health Wed, 12 Oct 2022 01:52:25 +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 medicare – Health-HQ https://www.healthhq.guru 32 32 Why It’s Crucial To Compare Medical Enrolment   https://www.healthhq.guru/health/why-its-crucial-to-compare-medical-enrolment/ Wed, 12 Oct 2022 01:49:47 +0000 https://www.healthhq.guru/?p=928 7 in 10 of those eligible for Medicare don’t compare their plan options. This is not the recommended course of action and you may be missing out by not checking. The Medicare enrolment period is from October 15th to December 7th and represents the best possible time to reassess your health and prescription needs and make sure you have the right plan that suits your needs and budget.

What Are Your Options?

There are a variety of different options to choose from during this open enrolment period

  • Medicare Advantage vs Original Medicare:

You can switch between these two. Over the last few years Medicare Advantage plans have been more preferred due to their inclusions of prescription drug coverage, dental, hearing aids and vision. Every year the Medicare Advantage plan changes so it’s important to review it carefully.

  • Change from a Medicare Advantage plan without drug coverage to a Medicare Advantage plan with drug coverage, or vice versa

Depending on if the amount or type of prescription drugs have changed over the course of the year this may be very relevant to you and may be a good time to change or switch. Ultimately you can change from one Medicare Advantage Plan to another plan from the same company or with a different company.

  • Medicare Part D

Medicare Part D covers additional medications whereas Original Medicare doesn’t come with prescription drug coverage

What is the impact of the Inflation Reduction Act

As a result of passing the Inflation Reduction Act there are a few various changes. If you have diabetes and use insulin to manage your condition, this new benefit will save you money each month on the cost of your medication. The $35 cap applies to all covered insulin products, including traditional pumps (which fall under Part B). The Part D deductible also won’t apply, so you will save even more money on your prescription costs

Overall the Inflation Reduction Act is a positive for Medicare users. Before the Inflation Reduction Act, almost 5 million Americans struggled to afford their prescription drugs. The Inflation Reduction Act makes changes to Medicare so that millions of people with Medicare will spend less on their prescriptions.

People with Medicare prescription drug coverage will be happy to know that starting in 2025, there will be a yearly cap of $2,000 on what they pay out-of-pocket for prescription drugs. In addition, they will have the option to pay their prescription costs in monthly amounts spread over the year rather than all at once.

What’s Not Included?

Whilst Medicare Advantage and Original Medicare often talk about all their inclusions it may be harder and more important to tell what it doesn’t include.

One of the main ones is healthcare received outside of the country. This may apply to many over 65+ retirees who are looking to increase their travel later in life. Original Medicare does not pay for health care that you receive while traveling outside of the US. In order to get outside of US care you may require a Medigap plan from a private insurer.

Long term care is another that is often not included. These can end up being high costs for things like nursing homes, and long term care.

Dental care is sometimes included and sometimes not and it’s important to check. Original Medicare doesn’t cover the majority of dental care procedures. The same goes with regards to Original Medicare and hearing aids.

]]>