Version Description
- FIX JS for Insights and Documentation link
- FIX Fatal error with automatic update (PRO)
Download this release
Release Info
Developer | rainbowgeek |
Plugin | SEOPress |
Version | 5.7.1 |
Comparing to | |
See all releases |
Code changes from version 5.7 to 5.7.1
- assets/js/seopress-tabs.js +1 -2
- assets/js/seopress-tabs.min.js +1 -1
- inc/admin/callbacks/Analytics.php +1 -1
- inc/admin/docs/DocsLinks.php +2 -2
- inc/admin/metaboxes/admin-metaboxes-form.php +2 -2
- inc/admin/page-builders/elementor/inc/controls/class-social-preview-control.php +2 -2
- inc/functions/options-instant-indexing.php +2 -2
- languages/wp-seopress.pot +14 -8
- readme.txt +4 -1
- seopress.php +2 -2
- vendor/composer/installed.json +20 -15
- vendor/composer/installed.php +8 -8
- vendor/firebase/php-jwt/README.md +64 -25
- vendor/firebase/php-jwt/composer.json +6 -1
- vendor/firebase/php-jwt/phpstan.neon.dist +0 -5
- vendor/firebase/php-jwt/src/CachedKeySet.php +231 -0
- vendor/firebase/php-jwt/src/JWK.php +15 -7
- vendor/firebase/php-jwt/src/JWT.php +17 -21
- vendor/firebase/php-jwt/src/Key.php +3 -3
assets/js/seopress-tabs.js
CHANGED
@@ -7,8 +7,7 @@ jQuery(document).ready(function ($) {
|
|
7 |
["seopress_google_analytics_enable", "seopress_google_analytics_enable"],
|
8 |
["seopress_tool_settings", "seopress_tool_settings"],
|
9 |
["seopress_instant_indexing_general", "seopress_instant_indexing_general"],
|
10 |
-
["seopress_insights_general", "seopress_insights_general"]
|
11 |
-
["seopress_insights_alerts", "seopress_insights_alerts"],
|
12 |
];
|
13 |
|
14 |
features.forEach(function (item) {
|
7 |
["seopress_google_analytics_enable", "seopress_google_analytics_enable"],
|
8 |
["seopress_tool_settings", "seopress_tool_settings"],
|
9 |
["seopress_instant_indexing_general", "seopress_instant_indexing_general"],
|
10 |
+
["seopress_insights_general", "seopress_insights_general"]
|
|
|
11 |
];
|
12 |
|
13 |
features.forEach(function (item) {
|
assets/js/seopress-tabs.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(s){function e(s){return s.val().length>0?meta=s.val()+" ":meta=s.val(),meta}const t=[["seopress_titles","seopress_titles_home"],["seopress_xml_sitemap_tab","seopress_xml_sitemap_general"],["seopress_social_tab","seopress_social_knowledge"],["seopress_advanced_tab","seopress_advanced_image"],["seopress_google_analytics_enable","seopress_google_analytics_enable"],["seopress_tool_settings","seopress_tool_settings"],["seopress_instant_indexing_general","seopress_instant_indexing_general"],["seopress_insights_general","seopress_insights_general"]
|
1 |
+
jQuery(document).ready(function(s){function e(s){return s.val().length>0?meta=s.val()+" ":meta=s.val(),meta}const t=[["seopress_titles","seopress_titles_home"],["seopress_xml_sitemap_tab","seopress_xml_sitemap_general"],["seopress_social_tab","seopress_social_knowledge"],["seopress_advanced_tab","seopress_advanced_image"],["seopress_google_analytics_enable","seopress_google_analytics_enable"],["seopress_tool_settings","seopress_tool_settings"],["seopress_instant_indexing_general","seopress_instant_indexing_general"],["seopress_insights_general","seopress_insights_general"]];t.forEach(function(e){var t=s(location).attr("hash").split("#tab=")[1];if(void 0!==t)s("#"+t+"-tab").addClass("nav-tab-active"),s("#"+t).addClass("active");else{if("undefined"!=typeof sessionStorage&&"null"!=typeof sessionStorage){var a=sessionStorage.getItem("seopress_save_tab");a&&s("#"+a+"-tab").length?(s("#seopress-tabs").find(".nav-tab.nav-tab-active").removeClass("nav-tab-active"),s("#seopress-tabs").find(".seopress-tab.active").removeClass("active"),s("#"+a+"-tab").addClass("nav-tab-active"),s("#"+a).addClass("active")):(s("#tab_"+e[1]+"-tab").addClass("nav-tab-active"),s("#tab_"+e[1]).addClass("active"))}s("#seopress-tabs").find("a.nav-tab").click(function(e){e.preventDefault();var t=s(this).attr("href").split("#tab=")[1];s("#seopress-tabs").find(".nav-tab.nav-tab-active").removeClass("nav-tab-active"),s("#"+t+"-tab").addClass("nav-tab-active"),sessionStorage.setItem("seopress_save_tab",t),s("#seopress-tabs").find(".seopress-tab.active").removeClass("active"),s("#"+t).addClass("active")})}});let a=!1;if(s("#seopress-tag-site-title").click(function(){s("#seopress_titles_home_site_title").val(e(s("#seopress_titles_home_site_title"))+s("#seopress-tag-site-title").attr("data-tag"))}),s("#seopress-tag-site-desc").click(function(){s("#seopress_titles_home_site_title").val(e(s("#seopress_titles_home_site_title"))+s("#seopress-tag-site-desc").attr("data-tag"))}),s("#seopress-tag-site-sep").click(function(){s("#seopress_titles_home_site_title").val(e(s("#seopress_titles_home_site_title"))+s("#seopress-tag-site-sep").attr("data-tag"))}),s("#seopress-tag-meta-desc").click(function(){s("#seopress_titles_home_site_desc").val(e(s("#seopress_titles_home_site_desc"))+s("#seopress-tag-meta-desc").attr("data-tag"))}),s("#seopress-tag-post-author").click(function(){s("#seopress_titles_archive_post_author").val(e(s("#seopress_titles_archive_post_author"))+s("#seopress-tag-post-author").attr("data-tag"))}),s("#seopress-tag-sep-author").click(function(){s("#seopress_titles_archive_post_author").val(e(s("#seopress_titles_archive_post_author"))+s("#seopress-tag-sep-author").attr("data-tag"))}),s("#seopress-tag-site-title-author").click(function(){s("#seopress_titles_archive_post_author").val(e(s("#seopress_titles_archive_post_author"))+s("#seopress-tag-site-title-author").attr("data-tag"))}),s("#seopress-tag-archive-date").click(function(){s("#seopress_titles_archives_date_title").val(e(s("#seopress_titles_archives_date_title"))+s("#seopress-tag-archive-date").attr("data-tag"))}),s("#seopress-tag-sep-date").click(function(){s("#seopress_titles_archives_date_title").val(e(s("#seopress_titles_archives_date_title"))+s("#seopress-tag-sep-date").attr("data-tag"))}),s("#seopress-tag-site-title-date").click(function(){s("#seopress_titles_archives_date_title").val(e(s("#seopress_titles_archives_date_title"))+s("#seopress-tag-site-title-date").attr("data-tag"))}),s("#seopress-tag-search-keywords").click(function(){s("#seopress_titles_archives_search_title").val(e(s("#seopress_titles_archives_search_title"))+s("#seopress-tag-search-keywords").attr("data-tag"))}),s("#seopress-tag-sep-search").click(function(){s("#seopress_titles_archives_search_title").val(e(s("#seopress_titles_archives_search_title"))+s("#seopress-tag-sep-search").attr("data-tag"))}),s("#seopress-tag-site-title-search").click(function(){s("#seopress_titles_archives_search_title").val(e(s("#seopress_titles_archives_search_title"))+s("#seopress-tag-site-title-search").attr("data-tag"))}),s("#seopress-tag-site-title-404").click(function(){s("#seopress_titles_archives_404_title").val(e(s("#seopress_titles_archives_404_title"))+s("#seopress-tag-site-title-404").attr("data-tag"))}),s("#seopress-tag-sep-404").click(function(){s("#seopress_titles_archives_404_title").val(e(s("#seopress_titles_archives_404_title"))+s("#seopress-tag-sep-404").attr("data-tag"))}),s("#seopress-tag-post-title-bd-groups").click(function(){s("#seopress_titles_bp_groups_title").val(e(s("#seopress_titles_bp_groups_title"))+s("#seopress-tag-post-title-bd-groups").attr("data-tag"))}),s("#seopress-tag-sep-bd-groups").click(function(){s("#seopress_titles_bp_groups_title").val(e(s("#seopress_titles_bp_groups_title"))+s("#seopress-tag-sep-bd-groups").attr("data-tag"))}),s("#seopress-tag-site-title-bd-groups").click(function(){s("#seopress_titles_bp_groups_title").val(e(s("#seopress_titles_bp_groups_title"))+s("#seopress-tag-site-title-bd-groups").attr("data-tag"))}),s(".seopress-tag-dropdown").each(function(t){function i(t){_.hasClass("tag-title")&&(n.val(e(n)+s(t).attr("data-value")),n.trigger("paste")),_.hasClass("tag-description")&&(o.val(e(o)+s(t).attr("data-value")),o.trigger("paste"))}const n=s(this).parent(".wrap-tags").prev("input"),o=s(this).parent(".wrap-tags").prev("textarea"),_=s(this);s(this).on("click",function(){function e(t){s(t.target).hasClass("dashicons")||s(t.target).hasClass("seopress-tag-single-all")||(a=!1,s(document).off("click",e),s(".sp-wrap-tag-variables-list").removeClass("open"))}s(this).next(".sp-wrap-tag-variables-list").toggleClass("open"),s(this).next(".sp-wrap-tag-variables-list").find("li").on("click",function(s){i(this),s.stopImmediatePropagation()}).on("keyup",function(s){13===s.keyCode&&(i(this),s.stopImmediatePropagation())}),a||(a=!0,s(document).on("click",e))})}),s("#seopress_instant_indexing_manual_batch").length){newLines=s("#seopress_instant_indexing_manual_batch").val().split("\n").length,s("#seopress_instant_indexing_url_count").text(newLines);var i=50,n=s("#seopress_instant_indexing_url_count");if(newLines){var o=Math.round(newLines/50*100);o>=100&&(o=100),s("#seopress_instant_indexing_url_progress").attr("aria-valuenow",o),s("#seopress_instant_indexing_url_progress").text(o+"%"),s("#seopress_instant_indexing_url_progress").css("width",o+"%")}s("#seopress_instant_indexing_manual_batch").on("keyup paste change click focus mouseout",function(e){if(newLines=s(this).val().split("\n").length,n.text(newLines),newLines>i?n.css("color","red"):n.css("color",""),newLines)var t=Math.round(newLines/50*100);t>=100&&(t=100),s("#seopress_instant_indexing_url_progress").attr("aria-valuenow",t),s("#seopress_instant_indexing_url_progress").text(t+"%"),s("#seopress_instant_indexing_url_progress").css("width",t+"%")})}s("#seopress_instant_indexing_google_action_include[URL_UPDATED]").is(":checked"),s(".seopress-instant-indexing-batch").on("click",function(){s("#seopress-tabs .spinner").css("visibility","visible"),s("#seopress-tabs .spinner").css("float","none"),s.ajax({method:"POST",url:seopressAjaxInstantIndexingPost.seopress_instant_indexing_post,data:{action:"seopress_instant_indexing_post",urls_to_submit:s("#seopress_instant_indexing_manual_batch").val(),indexnow_api:s("#seopress_instant_indexing_bing_api_key").val(),google_api:s("#seopress_instant_indexing_google_api_key").val(),update_action:!!s("#seopress_instant_indexing_google_action_include_URL_UPDATED").is(":checked")&&"URL_UPDATED",delete_action:!!s("#seopress_instant_indexing_google_action_include_URL_DELETED").is(":checked")&&"URL_DELETED",google:!!s("#seopress_instant_indexing_engines_google").is(":checked"),bing:!!s("#seopress_instant_indexing_engines_bing").is(":checked"),automatic_submission:!!s("#seopress_instant_indexing_automate_submission").is(":checked"),_ajax_nonce:seopressAjaxInstantIndexingPost.seopress_nonce},success:function(s){window.location.reload(!0)}})}),s(".seopress-instant-indexing-refresh-api-key").on("click",function(){s.ajax({method:"POST",url:seopressAjaxInstantIndexingApiKey.seopress_instant_indexing_generate_api_key,data:{action:"seopress_instant_indexing_generate_api_key",_ajax_nonce:seopressAjaxInstantIndexingApiKey.seopress_nonce},success:function(s){window.location.reload(!0)}})})});
|
inc/admin/callbacks/Analytics.php
CHANGED
@@ -667,7 +667,7 @@ function seopress_google_analytics_other_tracking_footer_callback() {
|
|
667 |
$check = isset($options['seopress_google_analytics_other_tracking_footer']) ? $options['seopress_google_analytics_other_tracking_footer'] : null;
|
668 |
|
669 |
printf(
|
670 |
-
'<textarea id="seopress_google_analytics_other_tracking_footer" name="seopress_google_analytics_option_name[seopress_google_analytics_other_tracking_footer]" rows="16" placeholder="' . esc_html__('Paste your tracking code here (
|
671 |
esc_textarea($check)); ?>
|
672 |
|
673 |
<p class="description">
|
667 |
$check = isset($options['seopress_google_analytics_other_tracking_footer']) ? $options['seopress_google_analytics_other_tracking_footer'] : null;
|
668 |
|
669 |
printf(
|
670 |
+
'<textarea id="seopress_google_analytics_other_tracking_footer" name="seopress_google_analytics_option_name[seopress_google_analytics_other_tracking_footer]" rows="16" placeholder="' . esc_html__('Paste your tracking code here (footer)', 'wp-seopress') . '" aria-label="' . __('Additional tracking code field added to footer', 'wp-seopress') . '">%s</textarea>',
|
671 |
esc_textarea($check)); ?>
|
672 |
|
673 |
<p class="description">
|
inc/admin/docs/DocsLinks.php
CHANGED
@@ -137,7 +137,7 @@ function seopress_get_docs_links()
|
|
137 |
'insights' => 'https://www.seopress.org/fr/extensions-seo-wordpress/seopress-insights/' . $utm,
|
138 |
],
|
139 |
'insights' => [
|
140 |
-
'slack_webhook' => 'https://
|
141 |
]
|
142 |
];
|
143 |
} else {
|
@@ -266,7 +266,7 @@ function seopress_get_docs_links()
|
|
266 |
'insights' => 'https://www.seopress.org/wordpress-seo-plugins/insights/' . $utm,
|
267 |
],
|
268 |
'insights' => [
|
269 |
-
'slack_webhook' => 'https://
|
270 |
]
|
271 |
];
|
272 |
}
|
137 |
'insights' => 'https://www.seopress.org/fr/extensions-seo-wordpress/seopress-insights/' . $utm,
|
138 |
],
|
139 |
'insights' => [
|
140 |
+
'slack_webhook' => 'https://www.seopress.org/fr/support/guides/configurer-les-notifications-slack-avec-seopress-insights/' . $utm
|
141 |
]
|
142 |
];
|
143 |
} else {
|
266 |
'insights' => 'https://www.seopress.org/wordpress-seo-plugins/insights/' . $utm,
|
267 |
],
|
268 |
'insights' => [
|
269 |
+
'slack_webhook' => 'https://www.seopress.org/support/guides/how-to-setup-slack-notifications-with-seopress-insights/' . $utm
|
270 |
]
|
271 |
];
|
272 |
}
|
inc/admin/metaboxes/admin-metaboxes-form.php
CHANGED
@@ -450,7 +450,7 @@ if ('term.php' == $pagenow || 'edit-tags.php' == $pagenow) { ?>
|
|
450 |
</p>
|
451 |
</div>
|
452 |
<div class="snippet-fb-img-alert alert2" style="display:none">
|
453 |
-
<p class="notice notice-error"><?php _e('
|
454 |
</p>
|
455 |
</div>
|
456 |
<div class="snippet-fb-img-alert alert3" style="display:none">
|
@@ -567,7 +567,7 @@ if ('term.php' == $pagenow || 'edit-tags.php' == $pagenow) { ?>
|
|
567 |
</p>
|
568 |
</div>
|
569 |
<div class="snippet-twitter-img-alert alert2" style="display:none">
|
570 |
-
<p class="notice notice-error"><?php _e('
|
571 |
</p>
|
572 |
</div>
|
573 |
<div class="snippet-twitter-img-alert alert3" style="display:none">
|
450 |
</p>
|
451 |
</div>
|
452 |
<div class="snippet-fb-img-alert alert2" style="display:none">
|
453 |
+
<p class="notice notice-error"><?php _e('Minimum size for Facebook is <strong>200x200px</strong>. Please choose another image.', 'wp-seopress'); ?>
|
454 |
</p>
|
455 |
</div>
|
456 |
<div class="snippet-fb-img-alert alert3" style="display:none">
|
567 |
</p>
|
568 |
</div>
|
569 |
<div class="snippet-twitter-img-alert alert2" style="display:none">
|
570 |
+
<p class="notice notice-error"><?php _e('Minimum size for Twitter is <strong>144x144px</strong>. Please choose another image.', 'wp-seopress'); ?>
|
571 |
</p>
|
572 |
</div>
|
573 |
<div class="snippet-twitter-img-alert alert3" style="display:none">
|
inc/admin/page-builders/elementor/inc/controls/class-social-preview-control.php
CHANGED
@@ -44,7 +44,7 @@ class Social_Preview_Control extends \Elementor\Base_Control {
|
|
44 |
<label class="elementor-control-title">{{{ data.label }}}</label>
|
45 |
<div class="elementor-control-field facebook-snippet-box">
|
46 |
<div class="snippet-fb-img-alert alert1" style="display:none"><p class="notice notice-error"><?php _e('File type not supported by Facebook. Please choose another image.', 'wp-seopress'); ?></p></div>
|
47 |
-
<div class="snippet-fb-img-alert alert2" style="display:none"><p class="notice notice-error"><?php _e('
|
48 |
<div class="snippet-fb-img-alert alert3" style="display:none"><p class="notice notice-error"><?php _e('File error. Please choose another image.', 'wp-seopress'); ?></p></div>
|
49 |
<div class="snippet-fb-img-alert alert4" style="display:none"><p class="notice notice-info"><?php _e('Your image ratio is: ', 'wp-seopress'); ?><span></span><?php _e('. The closer to 1.91 the better.', 'wp-seopress'); ?></p></div>
|
50 |
<div class="snippet-fb-img-alert alert5" style="display:none"><p class="notice notice-error"><?php _e('File URL is not valid.', 'wp-seopress'); ?></p></div>
|
@@ -68,7 +68,7 @@ class Social_Preview_Control extends \Elementor\Base_Control {
|
|
68 |
<label class="elementor-control-title">{{{ data.label }}}</label>
|
69 |
<div class="elementor-control-field twitter-snippet-box">
|
70 |
<div class="snippet-twitter-img-alert alert1" style="display:none"><p class="notice notice-error"><?php _e('File type not supported by Twitter. Please choose another image.', 'wp-seopress'); ?></p></div>
|
71 |
-
<div class="snippet-twitter-img-alert alert2" style="display:none"><p class="notice notice-error"><?php _e('
|
72 |
<div class="snippet-twitter-img-alert alert3" style="display:none"><p class="notice notice-error"><?php _e('File error. Please choose another image.', 'wp-seopress'); ?></p></div>
|
73 |
<div class="snippet-twitter-img-alert alert4" style="display:none"><p class="notice notice-info"><?php _e('Your image ratio is: ', 'wp-seopress'); ?><span></span><?php _e('. The closer to 1 the better (with large card, 2 is better).', 'wp-seopress'); ?></p></div>
|
74 |
<div class="snippet-twitter-img-alert alert5" style="display:none"><p class="notice notice-error"><?php _e('File URL is not valid.', 'wp-seopress'); ?></p></div>
|
44 |
<label class="elementor-control-title">{{{ data.label }}}</label>
|
45 |
<div class="elementor-control-field facebook-snippet-box">
|
46 |
<div class="snippet-fb-img-alert alert1" style="display:none"><p class="notice notice-error"><?php _e('File type not supported by Facebook. Please choose another image.', 'wp-seopress'); ?></p></div>
|
47 |
+
<div class="snippet-fb-img-alert alert2" style="display:none"><p class="notice notice-error"><?php _e('Minimum size for Facebook is <strong>200x200px</strong>. Please choose another image.', 'wp-seopress'); ?></p></div>
|
48 |
<div class="snippet-fb-img-alert alert3" style="display:none"><p class="notice notice-error"><?php _e('File error. Please choose another image.', 'wp-seopress'); ?></p></div>
|
49 |
<div class="snippet-fb-img-alert alert4" style="display:none"><p class="notice notice-info"><?php _e('Your image ratio is: ', 'wp-seopress'); ?><span></span><?php _e('. The closer to 1.91 the better.', 'wp-seopress'); ?></p></div>
|
50 |
<div class="snippet-fb-img-alert alert5" style="display:none"><p class="notice notice-error"><?php _e('File URL is not valid.', 'wp-seopress'); ?></p></div>
|
68 |
<label class="elementor-control-title">{{{ data.label }}}</label>
|
69 |
<div class="elementor-control-field twitter-snippet-box">
|
70 |
<div class="snippet-twitter-img-alert alert1" style="display:none"><p class="notice notice-error"><?php _e('File type not supported by Twitter. Please choose another image.', 'wp-seopress'); ?></p></div>
|
71 |
+
<div class="snippet-twitter-img-alert alert2" style="display:none"><p class="notice notice-error"><?php _e('Minimum size for Twitter is <strong>144x144px</strong>. Please choose another image.', 'wp-seopress'); ?></p></div>
|
72 |
<div class="snippet-twitter-img-alert alert3" style="display:none"><p class="notice notice-error"><?php _e('File error. Please choose another image.', 'wp-seopress'); ?></p></div>
|
73 |
<div class="snippet-twitter-img-alert alert4" style="display:none"><p class="notice notice-info"><?php _e('Your image ratio is: ', 'wp-seopress'); ?><span></span><?php _e('. The closer to 1 the better (with large card, 2 is better).', 'wp-seopress'); ?></p></div>
|
74 |
<div class="snippet-twitter-img-alert alert5" style="display:none"><p class="notice notice-error"><?php _e('File URL is not valid.', 'wp-seopress'); ?></p></div>
|
inc/functions/options-instant-indexing.php
CHANGED
@@ -134,13 +134,13 @@ function seopress_instant_indexing_fn($is_manual_submission = true, $permalink =
|
|
134 |
//Prepare the URLS
|
135 |
if ($is_manual_submission === true) {
|
136 |
$urls = preg_split('/\r\n|\r|\n/', $urls);
|
137 |
-
$x_source_info = 'https://www.seopress.org/5.7/true';
|
138 |
|
139 |
$urls = array_slice($urls, 0, 100);
|
140 |
} elseif ($is_manual_submission === false && !empty($permalink)) {
|
141 |
$urls = null;
|
142 |
$urls[] = $permalink;
|
143 |
-
$x_source_info = 'https://www.seopress.org/5.7/false';
|
144 |
}
|
145 |
|
146 |
//Bing API
|
134 |
//Prepare the URLS
|
135 |
if ($is_manual_submission === true) {
|
136 |
$urls = preg_split('/\r\n|\r|\n/', $urls);
|
137 |
+
$x_source_info = 'https://www.seopress.org/5.7.1/true';
|
138 |
|
139 |
$urls = array_slice($urls, 0, 100);
|
140 |
} elseif ($is_manual_submission === false && !empty($permalink)) {
|
141 |
$urls = null;
|
142 |
$urls[] = $permalink;
|
143 |
+
$x_source_info = 'https://www.seopress.org/5.7.1/false';
|
144 |
}
|
145 |
|
146 |
//Bing API
|
languages/wp-seopress.pot
CHANGED
@@ -2,14 +2,14 @@
|
|
2 |
# This file is distributed under the GPLv2.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: SEOPress 5.7\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-seopress\n"
|
7 |
"Last-Translator: SEOPress Team <contact@seopress.org>\n"
|
8 |
"Language-Team: SEOPress Team <contact@seopress.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"POT-Creation-Date: 2022-05-
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.6.0\n"
|
15 |
"X-Domain: wp-seopress\n"
|
@@ -2161,11 +2161,11 @@ msgid "Learn how to integrate Google Tag Manager"
|
|
2161 |
msgstr ""
|
2162 |
|
2163 |
#: inc/admin/callbacks/Analytics.php:670
|
2164 |
-
msgid "Paste your tracking code here (
|
2165 |
msgstr ""
|
2166 |
|
2167 |
#: inc/admin/callbacks/Analytics.php:670
|
2168 |
-
msgid "Additional tracking code field added to
|
2169 |
msgstr ""
|
2170 |
|
2171 |
#: inc/admin/callbacks/Analytics.php:674
|
@@ -3686,8 +3686,7 @@ msgstr ""
|
|
3686 |
|
3687 |
#: inc/admin/metaboxes/admin-metaboxes-form.php:453
|
3688 |
#: inc/admin/page-builders/elementor/inc/controls/class-social-preview-control.php:47
|
3689 |
-
|
3690 |
-
msgid "Minimun size for Facebook is <strong>200x200px</strong>. Please choose another image."
|
3691 |
msgstr ""
|
3692 |
|
3693 |
#: inc/admin/metaboxes/admin-metaboxes-form.php:457
|
@@ -3783,8 +3782,7 @@ msgstr ""
|
|
3783 |
|
3784 |
#: inc/admin/metaboxes/admin-metaboxes-form.php:570
|
3785 |
#: inc/admin/page-builders/elementor/inc/controls/class-social-preview-control.php:71
|
3786 |
-
|
3787 |
-
msgid "Minimun size for Twitter is <strong>144x144px</strong>. Please choose another image."
|
3788 |
msgstr ""
|
3789 |
|
3790 |
#: inc/admin/metaboxes/admin-metaboxes-form.php:579
|
@@ -7015,11 +7013,19 @@ msgstr ""
|
|
7015 |
msgid "Your image ratio is:"
|
7016 |
msgstr ""
|
7017 |
|
|
|
|
|
|
|
|
|
7018 |
#: app/react/layout/Main/components/Social/Preview/index.js:291
|
7019 |
#: app/react/layout/Main/components/Social/Preview/index.js:379
|
7020 |
msgid "Please choose an image"
|
7021 |
msgstr ""
|
7022 |
|
|
|
|
|
|
|
|
|
7023 |
#: app/react/layout/Main/index.js:97
|
7024 |
#: app/react/layout/SeoBar/index.js:54
|
7025 |
msgid "Loading your data"
|
2 |
# This file is distributed under the GPLv2.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: SEOPress 5.7.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-seopress\n"
|
7 |
"Last-Translator: SEOPress Team <contact@seopress.org>\n"
|
8 |
"Language-Team: SEOPress Team <contact@seopress.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2022-05-18T08:39:59+00:00\n"
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.6.0\n"
|
15 |
"X-Domain: wp-seopress\n"
|
2161 |
msgstr ""
|
2162 |
|
2163 |
#: inc/admin/callbacks/Analytics.php:670
|
2164 |
+
msgid "Paste your tracking code here (footer)"
|
2165 |
msgstr ""
|
2166 |
|
2167 |
#: inc/admin/callbacks/Analytics.php:670
|
2168 |
+
msgid "Additional tracking code field added to footer"
|
2169 |
msgstr ""
|
2170 |
|
2171 |
#: inc/admin/callbacks/Analytics.php:674
|
3686 |
|
3687 |
#: inc/admin/metaboxes/admin-metaboxes-form.php:453
|
3688 |
#: inc/admin/page-builders/elementor/inc/controls/class-social-preview-control.php:47
|
3689 |
+
msgid "Minimum size for Facebook is <strong>200x200px</strong>. Please choose another image."
|
|
|
3690 |
msgstr ""
|
3691 |
|
3692 |
#: inc/admin/metaboxes/admin-metaboxes-form.php:457
|
3782 |
|
3783 |
#: inc/admin/metaboxes/admin-metaboxes-form.php:570
|
3784 |
#: inc/admin/page-builders/elementor/inc/controls/class-social-preview-control.php:71
|
3785 |
+
msgid "Minimum size for Twitter is <strong>144x144px</strong>. Please choose another image."
|
|
|
3786 |
msgstr ""
|
3787 |
|
3788 |
#: inc/admin/metaboxes/admin-metaboxes-form.php:579
|
7013 |
msgid "Your image ratio is:"
|
7014 |
msgstr ""
|
7015 |
|
7016 |
+
#: app/react/layout/Main/components/Social/Preview/index.js:265
|
7017 |
+
msgid "Minimun size for Facebook is <strong>200x200px</strong>. Please choose another image."
|
7018 |
+
msgstr ""
|
7019 |
+
|
7020 |
#: app/react/layout/Main/components/Social/Preview/index.js:291
|
7021 |
#: app/react/layout/Main/components/Social/Preview/index.js:379
|
7022 |
msgid "Please choose an image"
|
7023 |
msgstr ""
|
7024 |
|
7025 |
+
#: app/react/layout/Main/components/Social/Preview/index.js:353
|
7026 |
+
msgid "Minimun size for Twitter is <strong>144x144px</strong>. Please choose another image."
|
7027 |
+
msgstr ""
|
7028 |
+
|
7029 |
#: app/react/layout/Main/index.js:97
|
7030 |
#: app/react/layout/SeoBar/index.js:54
|
7031 |
msgid "Loading your data"
|
readme.txt
CHANGED
@@ -6,7 +6,7 @@ Tags: SEO, schema, xml sitemap, redirection, meta title, open graph, content ana
|
|
6 |
Requires at least: 4.7+
|
7 |
Tested up to: 6.0
|
8 |
Requires PHP: 7.2
|
9 |
-
Stable tag: 5.7
|
10 |
License: GPLv2 or later
|
11 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
@@ -362,6 +362,9 @@ You're theme is probably using a deprecated function to handle the title. <a hre
|
|
362 |
12. Schema metabox
|
363 |
|
364 |
== Changelog ==
|
|
|
|
|
|
|
365 |
= 5.7 <a href="https://www.seopress.org/newsroom/product-news/seopress-5-7/">Read the blog post update</a> =
|
366 |
* NEW Inspect URL with Google Search Console when you create / edit a post content (PRO) 🎉
|
367 |
* NEW Matomo On-Premise (self-hosted) tracking 🎉
|
6 |
Requires at least: 4.7+
|
7 |
Tested up to: 6.0
|
8 |
Requires PHP: 7.2
|
9 |
+
Stable tag: 5.7.1
|
10 |
License: GPLv2 or later
|
11 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
362 |
12. Schema metabox
|
363 |
|
364 |
== Changelog ==
|
365 |
+
= 5.7.1 =
|
366 |
+
* FIX JS for Insights and Documentation link
|
367 |
+
* FIX Fatal error with automatic update (PRO)
|
368 |
= 5.7 <a href="https://www.seopress.org/newsroom/product-news/seopress-5-7/">Read the blog post update</a> =
|
369 |
* NEW Inspect URL with Google Search Console when you create / edit a post content (PRO) 🎉
|
370 |
* NEW Matomo On-Premise (self-hosted) tracking 🎉
|
seopress.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: SEOPress
|
|
4 |
Plugin URI: https://www.seopress.org/
|
5 |
Description: One of the best SEO plugins for WordPress.
|
6 |
Author: SEOPress
|
7 |
-
Version: 5.7
|
8 |
Author URI: https://www.seopress.org/
|
9 |
License: GPLv2
|
10 |
Text Domain: wp-seopress
|
@@ -70,7 +70,7 @@ register_deactivation_hook(__FILE__, 'seopress_deactivation');
|
|
70 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
71 |
//Define
|
72 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
73 |
-
define('SEOPRESS_VERSION', '5.7');
|
74 |
define('SEOPRESS_AUTHOR', 'Benjamin Denis');
|
75 |
define('SEOPRESS_PLUGIN_DIR_PATH', plugin_dir_path(__FILE__));
|
76 |
define('SEOPRESS_PLUGIN_DIR_URL', plugin_dir_url(__FILE__));
|
4 |
Plugin URI: https://www.seopress.org/
|
5 |
Description: One of the best SEO plugins for WordPress.
|
6 |
Author: SEOPress
|
7 |
+
Version: 5.7.1
|
8 |
Author URI: https://www.seopress.org/
|
9 |
License: GPLv2
|
10 |
Text Domain: wp-seopress
|
70 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
71 |
//Define
|
72 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
73 |
+
define('SEOPRESS_VERSION', '5.7.1');
|
74 |
define('SEOPRESS_AUTHOR', 'Benjamin Denis');
|
75 |
define('SEOPRESS_PLUGIN_DIR_PATH', plugin_dir_path(__FILE__));
|
76 |
define('SEOPRESS_PLUGIN_DIR_URL', plugin_dir_url(__FILE__));
|
vendor/composer/installed.json
CHANGED
@@ -2,29 +2,34 @@
|
|
2 |
"packages": [
|
3 |
{
|
4 |
"name": "firebase/php-jwt",
|
5 |
-
"version": "v6.
|
6 |
-
"version_normalized": "6.
|
7 |
"source": {
|
8 |
"type": "git",
|
9 |
"url": "https://github.com/firebase/php-jwt.git",
|
10 |
-
"reference": "
|
11 |
},
|
12 |
"dist": {
|
13 |
"type": "zip",
|
14 |
-
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/
|
15 |
-
"reference": "
|
16 |
"shasum": ""
|
17 |
},
|
18 |
"require": {
|
19 |
"php": "^7.1||^8.0"
|
20 |
},
|
21 |
"require-dev": {
|
22 |
-
"
|
|
|
|
|
|
|
|
|
|
|
23 |
},
|
24 |
"suggest": {
|
25 |
"paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present"
|
26 |
},
|
27 |
-
"time": "2022-
|
28 |
"type": "library",
|
29 |
"installation-source": "dist",
|
30 |
"autoload": {
|
@@ -56,7 +61,7 @@
|
|
56 |
],
|
57 |
"support": {
|
58 |
"issues": "https://github.com/firebase/php-jwt/issues",
|
59 |
-
"source": "https://github.com/firebase/php-jwt/tree/v6.
|
60 |
},
|
61 |
"install-path": "../firebase/php-jwt"
|
62 |
},
|
@@ -136,17 +141,17 @@
|
|
136 |
},
|
137 |
{
|
138 |
"name": "google/apiclient-services",
|
139 |
-
"version": "v0.
|
140 |
-
"version_normalized": "0.
|
141 |
"source": {
|
142 |
"type": "git",
|
143 |
"url": "https://github.com/googleapis/google-api-php-client-services.git",
|
144 |
-
"reference": "
|
145 |
},
|
146 |
"dist": {
|
147 |
"type": "zip",
|
148 |
-
"url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/
|
149 |
-
"reference": "
|
150 |
"shasum": ""
|
151 |
},
|
152 |
"require": {
|
@@ -155,7 +160,7 @@
|
|
155 |
"require-dev": {
|
156 |
"phpunit/phpunit": "^5.7||^8.5.13"
|
157 |
},
|
158 |
-
"time": "2022-05-
|
159 |
"type": "library",
|
160 |
"installation-source": "dist",
|
161 |
"autoload": {
|
@@ -177,7 +182,7 @@
|
|
177 |
],
|
178 |
"support": {
|
179 |
"issues": "https://github.com/googleapis/google-api-php-client-services/issues",
|
180 |
-
"source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.
|
181 |
},
|
182 |
"install-path": "../google/apiclient-services"
|
183 |
},
|
2 |
"packages": [
|
3 |
{
|
4 |
"name": "firebase/php-jwt",
|
5 |
+
"version": "v6.2.0",
|
6 |
+
"version_normalized": "6.2.0.0",
|
7 |
"source": {
|
8 |
"type": "git",
|
9 |
"url": "https://github.com/firebase/php-jwt.git",
|
10 |
+
"reference": "d28e6df83830252650da4623c78aaaf98fb385f3"
|
11 |
},
|
12 |
"dist": {
|
13 |
"type": "zip",
|
14 |
+
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/d28e6df83830252650da4623c78aaaf98fb385f3",
|
15 |
+
"reference": "d28e6df83830252650da4623c78aaaf98fb385f3",
|
16 |
"shasum": ""
|
17 |
},
|
18 |
"require": {
|
19 |
"php": "^7.1||^8.0"
|
20 |
},
|
21 |
"require-dev": {
|
22 |
+
"guzzlehttp/guzzle": "^6.5||^7.4",
|
23 |
+
"phpspec/prophecy-phpunit": "^1.1",
|
24 |
+
"phpunit/phpunit": "^7.5||^9.5",
|
25 |
+
"psr/cache": "^1.0||^2.0",
|
26 |
+
"psr/http-client": "^1.0",
|
27 |
+
"psr/http-factory": "^1.0"
|
28 |
},
|
29 |
"suggest": {
|
30 |
"paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present"
|
31 |
},
|
32 |
+
"time": "2022-05-13T20:54:50+00:00",
|
33 |
"type": "library",
|
34 |
"installation-source": "dist",
|
35 |
"autoload": {
|
61 |
],
|
62 |
"support": {
|
63 |
"issues": "https://github.com/firebase/php-jwt/issues",
|
64 |
+
"source": "https://github.com/firebase/php-jwt/tree/v6.2.0"
|
65 |
},
|
66 |
"install-path": "../firebase/php-jwt"
|
67 |
},
|
141 |
},
|
142 |
{
|
143 |
"name": "google/apiclient-services",
|
144 |
+
"version": "v0.249.0",
|
145 |
+
"version_normalized": "0.249.0.0",
|
146 |
"source": {
|
147 |
"type": "git",
|
148 |
"url": "https://github.com/googleapis/google-api-php-client-services.git",
|
149 |
+
"reference": "95df14183356e45291e1c686cea57850281101db"
|
150 |
},
|
151 |
"dist": {
|
152 |
"type": "zip",
|
153 |
+
"url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/95df14183356e45291e1c686cea57850281101db",
|
154 |
+
"reference": "95df14183356e45291e1c686cea57850281101db",
|
155 |
"shasum": ""
|
156 |
},
|
157 |
"require": {
|
160 |
"require-dev": {
|
161 |
"phpunit/phpunit": "^5.7||^8.5.13"
|
162 |
},
|
163 |
+
"time": "2022-05-16T01:10:12+00:00",
|
164 |
"type": "library",
|
165 |
"installation-source": "dist",
|
166 |
"autoload": {
|
182 |
],
|
183 |
"support": {
|
184 |
"issues": "https://github.com/googleapis/google-api-php-client-services/issues",
|
185 |
+
"source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.249.0"
|
186 |
},
|
187 |
"install-path": "../google/apiclient-services"
|
188 |
},
|
vendor/composer/installed.php
CHANGED
@@ -5,18 +5,18 @@
|
|
5 |
'type' => 'wordpress-plugin',
|
6 |
'install_path' => __DIR__ . '/../../',
|
7 |
'aliases' => array(),
|
8 |
-
'reference' => '
|
9 |
'name' => 'wp-seopress/wp-seopress',
|
10 |
'dev' => false,
|
11 |
),
|
12 |
'versions' => array(
|
13 |
'firebase/php-jwt' => array(
|
14 |
-
'pretty_version' => 'v6.
|
15 |
-
'version' => '6.
|
16 |
'type' => 'library',
|
17 |
'install_path' => __DIR__ . '/../firebase/php-jwt',
|
18 |
'aliases' => array(),
|
19 |
-
'reference' => '
|
20 |
'dev_requirement' => false,
|
21 |
),
|
22 |
'google/apiclient' => array(
|
@@ -29,12 +29,12 @@
|
|
29 |
'dev_requirement' => false,
|
30 |
),
|
31 |
'google/apiclient-services' => array(
|
32 |
-
'pretty_version' => 'v0.
|
33 |
-
'version' => '0.
|
34 |
'type' => 'library',
|
35 |
'install_path' => __DIR__ . '/../google/apiclient-services',
|
36 |
'aliases' => array(),
|
37 |
-
'reference' => '
|
38 |
'dev_requirement' => false,
|
39 |
),
|
40 |
'google/auth' => array(
|
@@ -202,7 +202,7 @@
|
|
202 |
'type' => 'wordpress-plugin',
|
203 |
'install_path' => __DIR__ . '/../../',
|
204 |
'aliases' => array(),
|
205 |
-
'reference' => '
|
206 |
'dev_requirement' => false,
|
207 |
),
|
208 |
),
|
5 |
'type' => 'wordpress-plugin',
|
6 |
'install_path' => __DIR__ . '/../../',
|
7 |
'aliases' => array(),
|
8 |
+
'reference' => '28b00771b60f2cfbd91b3b527fb0edf80aea2b12',
|
9 |
'name' => 'wp-seopress/wp-seopress',
|
10 |
'dev' => false,
|
11 |
),
|
12 |
'versions' => array(
|
13 |
'firebase/php-jwt' => array(
|
14 |
+
'pretty_version' => 'v6.2.0',
|
15 |
+
'version' => '6.2.0.0',
|
16 |
'type' => 'library',
|
17 |
'install_path' => __DIR__ . '/../firebase/php-jwt',
|
18 |
'aliases' => array(),
|
19 |
+
'reference' => 'd28e6df83830252650da4623c78aaaf98fb385f3',
|
20 |
'dev_requirement' => false,
|
21 |
),
|
22 |
'google/apiclient' => array(
|
29 |
'dev_requirement' => false,
|
30 |
),
|
31 |
'google/apiclient-services' => array(
|
32 |
+
'pretty_version' => 'v0.249.0',
|
33 |
+
'version' => '0.249.0.0',
|
34 |
'type' => 'library',
|
35 |
'install_path' => __DIR__ . '/../google/apiclient-services',
|
36 |
'aliases' => array(),
|
37 |
+
'reference' => '95df14183356e45291e1c686cea57850281101db',
|
38 |
'dev_requirement' => false,
|
39 |
),
|
40 |
'google/auth' => array(
|
202 |
'type' => 'wordpress-plugin',
|
203 |
'install_path' => __DIR__ . '/../../',
|
204 |
'aliases' => array(),
|
205 |
+
'reference' => '28b00771b60f2cfbd91b3b527fb0edf80aea2b12',
|
206 |
'dev_requirement' => false,
|
207 |
),
|
208 |
),
|
vendor/firebase/php-jwt/README.md
CHANGED
@@ -29,13 +29,13 @@ Example
|
|
29 |
use Firebase\JWT\JWT;
|
30 |
use Firebase\JWT\Key;
|
31 |
|
32 |
-
$key =
|
33 |
-
$payload =
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
|
40 |
/**
|
41 |
* IMPORTANT:
|
@@ -98,12 +98,12 @@ ehde/zUxo6UvS7UrBQIDAQAB
|
|
98 |
-----END PUBLIC KEY-----
|
99 |
EOD;
|
100 |
|
101 |
-
$payload =
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
|
108 |
$jwt = JWT::encode($payload, $privateKey, 'RS256');
|
109 |
echo "Encode:\n" . print_r($jwt, true) . "\n";
|
@@ -139,12 +139,12 @@ $privateKey = openssl_pkey_get_private(
|
|
139 |
$passphrase
|
140 |
);
|
141 |
|
142 |
-
$payload =
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
|
149 |
$jwt = JWT::encode($payload, $privateKey, 'RS256');
|
150 |
echo "Encode:\n" . print_r($jwt, true) . "\n";
|
@@ -173,12 +173,12 @@ $privateKey = base64_encode(sodium_crypto_sign_secretkey($keyPair));
|
|
173 |
|
174 |
$publicKey = base64_encode(sodium_crypto_sign_publickey($keyPair));
|
175 |
|
176 |
-
$payload =
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
|
183 |
$jwt = JWT::encode($payload, $privateKey, 'EdDSA');
|
184 |
echo "Encode:\n" . print_r($jwt, true) . "\n";
|
@@ -203,6 +203,45 @@ $jwks = ['keys' => []];
|
|
203 |
JWT::decode($payload, JWK::parseKeySet($jwks));
|
204 |
```
|
205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
Miscellaneous
|
207 |
-------------
|
208 |
|
29 |
use Firebase\JWT\JWT;
|
30 |
use Firebase\JWT\Key;
|
31 |
|
32 |
+
$key = 'example_key';
|
33 |
+
$payload = [
|
34 |
+
'iss' => 'http://example.org',
|
35 |
+
'aud' => 'http://example.com',
|
36 |
+
'iat' => 1356999524,
|
37 |
+
'nbf' => 1357000000
|
38 |
+
];
|
39 |
|
40 |
/**
|
41 |
* IMPORTANT:
|
98 |
-----END PUBLIC KEY-----
|
99 |
EOD;
|
100 |
|
101 |
+
$payload = [
|
102 |
+
'iss' => 'example.org',
|
103 |
+
'aud' => 'example.com',
|
104 |
+
'iat' => 1356999524,
|
105 |
+
'nbf' => 1357000000
|
106 |
+
];
|
107 |
|
108 |
$jwt = JWT::encode($payload, $privateKey, 'RS256');
|
109 |
echo "Encode:\n" . print_r($jwt, true) . "\n";
|
139 |
$passphrase
|
140 |
);
|
141 |
|
142 |
+
$payload = [
|
143 |
+
'iss' => 'example.org',
|
144 |
+
'aud' => 'example.com',
|
145 |
+
'iat' => 1356999524,
|
146 |
+
'nbf' => 1357000000
|
147 |
+
];
|
148 |
|
149 |
$jwt = JWT::encode($payload, $privateKey, 'RS256');
|
150 |
echo "Encode:\n" . print_r($jwt, true) . "\n";
|
173 |
|
174 |
$publicKey = base64_encode(sodium_crypto_sign_publickey($keyPair));
|
175 |
|
176 |
+
$payload = [
|
177 |
+
'iss' => 'example.org',
|
178 |
+
'aud' => 'example.com',
|
179 |
+
'iat' => 1356999524,
|
180 |
+
'nbf' => 1357000000
|
181 |
+
];
|
182 |
|
183 |
$jwt = JWT::encode($payload, $privateKey, 'EdDSA');
|
184 |
echo "Encode:\n" . print_r($jwt, true) . "\n";
|
203 |
JWT::decode($payload, JWK::parseKeySet($jwks));
|
204 |
```
|
205 |
|
206 |
+
Using Cached Key Sets
|
207 |
+
---------------------
|
208 |
+
|
209 |
+
The `CachedKeySet` class can be used to fetch and cache JWKS (JSON Web Key Sets) from a public URI.
|
210 |
+
This has the following advantages:
|
211 |
+
|
212 |
+
1. The results are cached for performance.
|
213 |
+
2. If an unrecognized key is requested, the cache is refreshed, to accomodate for key rotation.
|
214 |
+
3. If rate limiting is enabled, the JWKS URI will not make more than 10 requests a second.
|
215 |
+
|
216 |
+
```php
|
217 |
+
use Firebase\JWT\CachedKeySet;
|
218 |
+
use Firebase\JWT\JWT;
|
219 |
+
|
220 |
+
// The URI for the JWKS you wish to cache the results from
|
221 |
+
$jwksUri = 'https://www.gstatic.com/iap/verify/public_key-jwk';
|
222 |
+
|
223 |
+
// Create an HTTP client (can be any PSR-7 compatible HTTP client)
|
224 |
+
$httpClient = new GuzzleHttp\Client();
|
225 |
+
|
226 |
+
// Create an HTTP request factory (can be any PSR-17 compatible HTTP request factory)
|
227 |
+
$httpFactory = new GuzzleHttp\Psr\HttpFactory();
|
228 |
+
|
229 |
+
// Create a cache item pool (can be any PSR-6 compatible cache item pool)
|
230 |
+
$cacheItemPool = Phpfastcache\CacheManager::getInstance('files');
|
231 |
+
|
232 |
+
$keySet = new CachedKeySet(
|
233 |
+
$jwksUri,
|
234 |
+
$httpClient,
|
235 |
+
$httpFactory,
|
236 |
+
$cacheItemPool,
|
237 |
+
null, // $expiresAfter int seconds to set the JWKS to expire
|
238 |
+
true // $rateLimit true to enable rate limit of 10 RPS on lookup of invalid keys
|
239 |
+
);
|
240 |
+
|
241 |
+
$jwt = 'eyJhbGci...'; // Some JWT signed by a key from the $jwkUri above
|
242 |
+
$decoded = JWT::decode($jwt, $keySet);
|
243 |
+
```
|
244 |
+
|
245 |
Miscellaneous
|
246 |
-------------
|
247 |
|
vendor/firebase/php-jwt/composer.json
CHANGED
@@ -31,6 +31,11 @@
|
|
31 |
}
|
32 |
},
|
33 |
"require-dev": {
|
34 |
-
"
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
}
|
31 |
}
|
32 |
},
|
33 |
"require-dev": {
|
34 |
+
"guzzlehttp/guzzle": "^6.5||^7.4",
|
35 |
+
"phpspec/prophecy-phpunit": "^1.1",
|
36 |
+
"phpunit/phpunit": "^7.5||^9.5",
|
37 |
+
"psr/cache": "^1.0||^2.0",
|
38 |
+
"psr/http-client": "^1.0",
|
39 |
+
"psr/http-factory": "^1.0"
|
40 |
}
|
41 |
}
|
vendor/firebase/php-jwt/phpstan.neon.dist
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
parameters:
|
2 |
-
level: 7
|
3 |
-
paths:
|
4 |
-
- src
|
5 |
-
treatPhpDocTypesAsCertain: false
|
|
|
|
|
|
|
|
|
|
vendor/firebase/php-jwt/src/CachedKeySet.php
ADDED
@@ -0,0 +1,231 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Firebase\JWT;
|
4 |
+
|
5 |
+
use ArrayAccess;
|
6 |
+
use LogicException;
|
7 |
+
use OutOfBoundsException;
|
8 |
+
use Psr\Cache\CacheItemInterface;
|
9 |
+
use Psr\Cache\CacheItemPoolInterface;
|
10 |
+
use Psr\Http\Client\ClientInterface;
|
11 |
+
use Psr\Http\Message\RequestFactoryInterface;
|
12 |
+
use RuntimeException;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @implements ArrayAccess<string, Key>
|
16 |
+
*/
|
17 |
+
class CachedKeySet implements ArrayAccess
|
18 |
+
{
|
19 |
+
/**
|
20 |
+
* @var string
|
21 |
+
*/
|
22 |
+
private $jwksUri;
|
23 |
+
/**
|
24 |
+
* @var ClientInterface
|
25 |
+
*/
|
26 |
+
private $httpClient;
|
27 |
+
/**
|
28 |
+
* @var RequestFactoryInterface
|
29 |
+
*/
|
30 |
+
private $httpFactory;
|
31 |
+
/**
|
32 |
+
* @var CacheItemPoolInterface
|
33 |
+
*/
|
34 |
+
private $cache;
|
35 |
+
/**
|
36 |
+
* @var ?int
|
37 |
+
*/
|
38 |
+
private $expiresAfter;
|
39 |
+
/**
|
40 |
+
* @var ?CacheItemInterface
|
41 |
+
*/
|
42 |
+
private $cacheItem;
|
43 |
+
/**
|
44 |
+
* @var array<string, Key>
|
45 |
+
*/
|
46 |
+
private $keySet;
|
47 |
+
/**
|
48 |
+
* @var string
|
49 |
+
*/
|
50 |
+
private $cacheKey;
|
51 |
+
/**
|
52 |
+
* @var string
|
53 |
+
*/
|
54 |
+
private $cacheKeyPrefix = 'jwks';
|
55 |
+
/**
|
56 |
+
* @var int
|
57 |
+
*/
|
58 |
+
private $maxKeyLength = 64;
|
59 |
+
/**
|
60 |
+
* @var bool
|
61 |
+
*/
|
62 |
+
private $rateLimit;
|
63 |
+
/**
|
64 |
+
* @var string
|
65 |
+
*/
|
66 |
+
private $rateLimitCacheKey;
|
67 |
+
/**
|
68 |
+
* @var int
|
69 |
+
*/
|
70 |
+
private $maxCallsPerMinute = 10;
|
71 |
+
/**
|
72 |
+
* @var string|null
|
73 |
+
*/
|
74 |
+
private $defaultAlg;
|
75 |
+
|
76 |
+
public function __construct(
|
77 |
+
string $jwksUri,
|
78 |
+
ClientInterface $httpClient,
|
79 |
+
RequestFactoryInterface $httpFactory,
|
80 |
+
CacheItemPoolInterface $cache,
|
81 |
+
int $expiresAfter = null,
|
82 |
+
bool $rateLimit = false,
|
83 |
+
string $defaultAlg = null
|
84 |
+
) {
|
85 |
+
$this->jwksUri = $jwksUri;
|
86 |
+
$this->httpClient = $httpClient;
|
87 |
+
$this->httpFactory = $httpFactory;
|
88 |
+
$this->cache = $cache;
|
89 |
+
$this->expiresAfter = $expiresAfter;
|
90 |
+
$this->rateLimit = $rateLimit;
|
91 |
+
$this->defaultAlg = $defaultAlg;
|
92 |
+
$this->setCacheKeys();
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* @param string $keyId
|
97 |
+
* @return Key
|
98 |
+
*/
|
99 |
+
public function offsetGet($keyId): Key
|
100 |
+
{
|
101 |
+
if (!$this->keyIdExists($keyId)) {
|
102 |
+
throw new OutOfBoundsException('Key ID not found');
|
103 |
+
}
|
104 |
+
return $this->keySet[$keyId];
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* @param string $keyId
|
109 |
+
* @return bool
|
110 |
+
*/
|
111 |
+
public function offsetExists($keyId): bool
|
112 |
+
{
|
113 |
+
return $this->keyIdExists($keyId);
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* @param string $offset
|
118 |
+
* @param Key $value
|
119 |
+
*/
|
120 |
+
public function offsetSet($offset, $value): void
|
121 |
+
{
|
122 |
+
throw new LogicException('Method not implemented');
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* @param string $offset
|
127 |
+
*/
|
128 |
+
public function offsetUnset($offset): void
|
129 |
+
{
|
130 |
+
throw new LogicException('Method not implemented');
|
131 |
+
}
|
132 |
+
|
133 |
+
private function keyIdExists(string $keyId): bool
|
134 |
+
{
|
135 |
+
$keySetToCache = null;
|
136 |
+
if (null === $this->keySet) {
|
137 |
+
$item = $this->getCacheItem();
|
138 |
+
// Try to load keys from cache
|
139 |
+
if ($item->isHit()) {
|
140 |
+
// item found! Return it
|
141 |
+
$this->keySet = $item->get();
|
142 |
+
}
|
143 |
+
}
|
144 |
+
|
145 |
+
if (!isset($this->keySet[$keyId])) {
|
146 |
+
if ($this->rateLimitExceeded()) {
|
147 |
+
return false;
|
148 |
+
}
|
149 |
+
$request = $this->httpFactory->createRequest('get', $this->jwksUri);
|
150 |
+
$jwksResponse = $this->httpClient->sendRequest($request);
|
151 |
+
$jwks = json_decode((string) $jwksResponse->getBody(), true);
|
152 |
+
$this->keySet = $keySetToCache = JWK::parseKeySet($jwks, $this->defaultAlg);
|
153 |
+
|
154 |
+
if (!isset($this->keySet[$keyId])) {
|
155 |
+
return false;
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
if ($keySetToCache) {
|
160 |
+
$item = $this->getCacheItem();
|
161 |
+
$item->set($keySetToCache);
|
162 |
+
if ($this->expiresAfter) {
|
163 |
+
$item->expiresAfter($this->expiresAfter);
|
164 |
+
}
|
165 |
+
$this->cache->save($item);
|
166 |
+
}
|
167 |
+
|
168 |
+
return true;
|
169 |
+
}
|
170 |
+
|
171 |
+
private function rateLimitExceeded(): bool
|
172 |
+
{
|
173 |
+
if (!$this->rateLimit) {
|
174 |
+
return false;
|
175 |
+
}
|
176 |
+
|
177 |
+
$cacheItem = $this->cache->getItem($this->rateLimitCacheKey);
|
178 |
+
if (!$cacheItem->isHit()) {
|
179 |
+
$cacheItem->expiresAfter(1); // # of calls are cached each minute
|
180 |
+
}
|
181 |
+
|
182 |
+
$callsPerMinute = (int) $cacheItem->get();
|
183 |
+
if (++$callsPerMinute > $this->maxCallsPerMinute) {
|
184 |
+
return true;
|
185 |
+
}
|
186 |
+
$cacheItem->set($callsPerMinute);
|
187 |
+
$this->cache->save($cacheItem);
|
188 |
+
return false;
|
189 |
+
}
|
190 |
+
|
191 |
+
private function getCacheItem(): CacheItemInterface
|
192 |
+
{
|
193 |
+
if (\is_null($this->cacheItem)) {
|
194 |
+
$this->cacheItem = $this->cache->getItem($this->cacheKey);
|
195 |
+
}
|
196 |
+
|
197 |
+
return $this->cacheItem;
|
198 |
+
}
|
199 |
+
|
200 |
+
private function setCacheKeys(): void
|
201 |
+
{
|
202 |
+
if (empty($this->jwksUri)) {
|
203 |
+
throw new RuntimeException('JWKS URI is empty');
|
204 |
+
}
|
205 |
+
|
206 |
+
// ensure we do not have illegal characters
|
207 |
+
$key = preg_replace('|[^a-zA-Z0-9_\.!]|', '', $this->jwksUri);
|
208 |
+
|
209 |
+
// add prefix
|
210 |
+
$key = $this->cacheKeyPrefix . $key;
|
211 |
+
|
212 |
+
// Hash keys if they exceed $maxKeyLength of 64
|
213 |
+
if (\strlen($key) > $this->maxKeyLength) {
|
214 |
+
$key = substr(hash('sha256', $key), 0, $this->maxKeyLength);
|
215 |
+
}
|
216 |
+
|
217 |
+
$this->cacheKey = $key;
|
218 |
+
|
219 |
+
if ($this->rateLimit) {
|
220 |
+
// add prefix
|
221 |
+
$rateLimitKey = $this->cacheKeyPrefix . 'ratelimit' . $key;
|
222 |
+
|
223 |
+
// Hash keys if they exceed $maxKeyLength of 64
|
224 |
+
if (\strlen($rateLimitKey) > $this->maxKeyLength) {
|
225 |
+
$rateLimitKey = substr(hash('sha256', $rateLimitKey), 0, $this->maxKeyLength);
|
226 |
+
}
|
227 |
+
|
228 |
+
$this->rateLimitCacheKey = $rateLimitKey;
|
229 |
+
}
|
230 |
+
}
|
231 |
+
}
|
vendor/firebase/php-jwt/src/JWK.php
CHANGED
@@ -24,6 +24,8 @@ class JWK
|
|
24 |
* Parse a set of JWK keys
|
25 |
*
|
26 |
* @param array<mixed> $jwks The JSON Web Key Set as an associative array
|
|
|
|
|
27 |
*
|
28 |
* @return array<string, Key> An associative array of key IDs (kid) to Key objects
|
29 |
*
|
@@ -33,7 +35,7 @@ class JWK
|
|
33 |
*
|
34 |
* @uses parseKey
|
35 |
*/
|
36 |
-
public static function parseKeySet(array $jwks): array
|
37 |
{
|
38 |
$keys = [];
|
39 |
|
@@ -47,7 +49,7 @@ class JWK
|
|
47 |
|
48 |
foreach ($jwks['keys'] as $k => $v) {
|
49 |
$kid = isset($v['kid']) ? $v['kid'] : $k;
|
50 |
-
if ($key = self::parseKey($v)) {
|
51 |
$keys[(string) $kid] = $key;
|
52 |
}
|
53 |
}
|
@@ -63,6 +65,8 @@ class JWK
|
|
63 |
* Parse a JWK key
|
64 |
*
|
65 |
* @param array<mixed> $jwk An individual JWK
|
|
|
|
|
66 |
*
|
67 |
* @return Key The key object for the JWK
|
68 |
*
|
@@ -72,7 +76,7 @@ class JWK
|
|
72 |
*
|
73 |
* @uses createPemFromModulusAndExponent
|
74 |
*/
|
75 |
-
public static function parseKey(array $jwk): ?Key
|
76 |
{
|
77 |
if (empty($jwk)) {
|
78 |
throw new InvalidArgumentException('JWK must not be empty');
|
@@ -83,10 +87,14 @@ class JWK
|
|
83 |
}
|
84 |
|
85 |
if (!isset($jwk['alg'])) {
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
|
|
|
|
|
|
|
|
90 |
}
|
91 |
|
92 |
switch ($jwk['kty']) {
|
24 |
* Parse a set of JWK keys
|
25 |
*
|
26 |
* @param array<mixed> $jwks The JSON Web Key Set as an associative array
|
27 |
+
* @param string $defaultAlg The algorithm for the Key object if "alg" is not set in the
|
28 |
+
* JSON Web Key Set
|
29 |
*
|
30 |
* @return array<string, Key> An associative array of key IDs (kid) to Key objects
|
31 |
*
|
35 |
*
|
36 |
* @uses parseKey
|
37 |
*/
|
38 |
+
public static function parseKeySet(array $jwks, string $defaultAlg = null): array
|
39 |
{
|
40 |
$keys = [];
|
41 |
|
49 |
|
50 |
foreach ($jwks['keys'] as $k => $v) {
|
51 |
$kid = isset($v['kid']) ? $v['kid'] : $k;
|
52 |
+
if ($key = self::parseKey($v, $defaultAlg)) {
|
53 |
$keys[(string) $kid] = $key;
|
54 |
}
|
55 |
}
|
65 |
* Parse a JWK key
|
66 |
*
|
67 |
* @param array<mixed> $jwk An individual JWK
|
68 |
+
* @param string $defaultAlg The algorithm for the Key object if "alg" is not set in the
|
69 |
+
* JSON Web Key Set
|
70 |
*
|
71 |
* @return Key The key object for the JWK
|
72 |
*
|
76 |
*
|
77 |
* @uses createPemFromModulusAndExponent
|
78 |
*/
|
79 |
+
public static function parseKey(array $jwk, string $defaultAlg = null): ?Key
|
80 |
{
|
81 |
if (empty($jwk)) {
|
82 |
throw new InvalidArgumentException('JWK must not be empty');
|
87 |
}
|
88 |
|
89 |
if (!isset($jwk['alg'])) {
|
90 |
+
if (\is_null($defaultAlg)) {
|
91 |
+
// The "alg" parameter is optional in a KTY, but an algorithm is required
|
92 |
+
// for parsing in this library. Use the $defaultAlg parameter when parsing the
|
93 |
+
// key set in order to prevent this error.
|
94 |
+
// @see https://datatracker.ietf.org/doc/html/rfc7517#section-4.4
|
95 |
+
throw new UnexpectedValueException('JWK must contain an "alg" parameter');
|
96 |
+
}
|
97 |
+
$jwk['alg'] = $defaultAlg;
|
98 |
}
|
99 |
|
100 |
switch ($jwk['kty']) {
|
vendor/firebase/php-jwt/src/JWT.php
CHANGED
@@ -3,15 +3,14 @@
|
|
3 |
namespace Firebase\JWT;
|
4 |
|
5 |
use ArrayAccess;
|
|
|
6 |
use DomainException;
|
7 |
use Exception;
|
8 |
use InvalidArgumentException;
|
9 |
use OpenSSLAsymmetricKey;
|
10 |
use OpenSSLCertificate;
|
11 |
-
use TypeError;
|
12 |
-
use UnexpectedValueException;
|
13 |
-
use DateTime;
|
14 |
use stdClass;
|
|
|
15 |
|
16 |
/**
|
17 |
* JSON Web Token implementation, based on this spec:
|
@@ -69,7 +68,7 @@ class JWT
|
|
69 |
* Decodes a JWT string into a PHP object.
|
70 |
*
|
71 |
* @param string $jwt The JWT
|
72 |
-
* @param Key|array<string,
|
73 |
* If the algorithm used is asymmetric, this is the public key
|
74 |
* Each Key object contains an algorithm and matching key.
|
75 |
* Supported algorithms are 'ES384','ES256', 'HS256', 'HS384',
|
@@ -111,7 +110,7 @@ class JWT
|
|
111 |
if (null === ($payload = static::jsonDecode($payloadRaw))) {
|
112 |
throw new UnexpectedValueException('Invalid claims encoding');
|
113 |
}
|
114 |
-
if (is_array($payload)) {
|
115 |
// prevent PHP Fatal Error in edge-cases when payload is empty array
|
116 |
$payload = (object) $payload;
|
117 |
}
|
@@ -229,7 +228,7 @@ class JWT
|
|
229 |
list($function, $algorithm) = static::$supported_algs[$alg];
|
230 |
switch ($function) {
|
231 |
case 'hash_hmac':
|
232 |
-
if (
|
233 |
throw new InvalidArgumentException('key must be a string when using hmac');
|
234 |
}
|
235 |
return \hash_hmac($algorithm, $msg, $key, true);
|
@@ -237,7 +236,7 @@ class JWT
|
|
237 |
$signature = '';
|
238 |
$success = \openssl_sign($msg, $signature, $key, $algorithm); // @phpstan-ignore-line
|
239 |
if (!$success) {
|
240 |
-
throw new DomainException(
|
241 |
}
|
242 |
if ($alg === 'ES256') {
|
243 |
$signature = self::signatureFromDER($signature, 256);
|
@@ -246,10 +245,10 @@ class JWT
|
|
246 |
}
|
247 |
return $signature;
|
248 |
case 'sodium_crypto':
|
249 |
-
if (
|
250 |
throw new DomainException('libsodium is not available');
|
251 |
}
|
252 |
-
if (
|
253 |
throw new InvalidArgumentException('key must be a string when using EdDSA');
|
254 |
}
|
255 |
try {
|
@@ -302,10 +301,10 @@ class JWT
|
|
302 |
'OpenSSL error: ' . \openssl_error_string()
|
303 |
);
|
304 |
case 'sodium_crypto':
|
305 |
-
if (
|
306 |
throw new DomainException('libsodium is not available');
|
307 |
}
|
308 |
-
if (
|
309 |
throw new InvalidArgumentException('key must be a string when using EdDSA');
|
310 |
}
|
311 |
try {
|
@@ -318,7 +317,7 @@ class JWT
|
|
318 |
}
|
319 |
case 'hash_hmac':
|
320 |
default:
|
321 |
-
if (
|
322 |
throw new InvalidArgumentException('key must be a string when using hmac');
|
323 |
}
|
324 |
$hash = \hash_hmac($algorithm, $msg, $keyMaterial, true);
|
@@ -410,7 +409,7 @@ class JWT
|
|
410 |
/**
|
411 |
* Determine if an algorithm has been provided for each Key
|
412 |
*
|
413 |
-
* @param Key|array<string,
|
414 |
* @param string|null $kid
|
415 |
*
|
416 |
* @throws UnexpectedValueException
|
@@ -425,15 +424,12 @@ class JWT
|
|
425 |
return $keyOrKeyArray;
|
426 |
}
|
427 |
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
'$keyOrKeyArray must be an instance of Firebase\JWT\Key key or an '
|
432 |
-
. 'array of Firebase\JWT\Key keys'
|
433 |
-
);
|
434 |
-
}
|
435 |
}
|
436 |
-
|
|
|
437 |
throw new UnexpectedValueException('"kid" empty, unable to lookup correct key');
|
438 |
}
|
439 |
if (!isset($keyOrKeyArray[$kid])) {
|
3 |
namespace Firebase\JWT;
|
4 |
|
5 |
use ArrayAccess;
|
6 |
+
use DateTime;
|
7 |
use DomainException;
|
8 |
use Exception;
|
9 |
use InvalidArgumentException;
|
10 |
use OpenSSLAsymmetricKey;
|
11 |
use OpenSSLCertificate;
|
|
|
|
|
|
|
12 |
use stdClass;
|
13 |
+
use UnexpectedValueException;
|
14 |
|
15 |
/**
|
16 |
* JSON Web Token implementation, based on this spec:
|
68 |
* Decodes a JWT string into a PHP object.
|
69 |
*
|
70 |
* @param string $jwt The JWT
|
71 |
+
* @param Key|array<string,Key> $keyOrKeyArray The Key or associative array of key IDs (kid) to Key objects.
|
72 |
* If the algorithm used is asymmetric, this is the public key
|
73 |
* Each Key object contains an algorithm and matching key.
|
74 |
* Supported algorithms are 'ES384','ES256', 'HS256', 'HS384',
|
110 |
if (null === ($payload = static::jsonDecode($payloadRaw))) {
|
111 |
throw new UnexpectedValueException('Invalid claims encoding');
|
112 |
}
|
113 |
+
if (\is_array($payload)) {
|
114 |
// prevent PHP Fatal Error in edge-cases when payload is empty array
|
115 |
$payload = (object) $payload;
|
116 |
}
|
228 |
list($function, $algorithm) = static::$supported_algs[$alg];
|
229 |
switch ($function) {
|
230 |
case 'hash_hmac':
|
231 |
+
if (!\is_string($key)) {
|
232 |
throw new InvalidArgumentException('key must be a string when using hmac');
|
233 |
}
|
234 |
return \hash_hmac($algorithm, $msg, $key, true);
|
236 |
$signature = '';
|
237 |
$success = \openssl_sign($msg, $signature, $key, $algorithm); // @phpstan-ignore-line
|
238 |
if (!$success) {
|
239 |
+
throw new DomainException('OpenSSL unable to sign data');
|
240 |
}
|
241 |
if ($alg === 'ES256') {
|
242 |
$signature = self::signatureFromDER($signature, 256);
|
245 |
}
|
246 |
return $signature;
|
247 |
case 'sodium_crypto':
|
248 |
+
if (!\function_exists('sodium_crypto_sign_detached')) {
|
249 |
throw new DomainException('libsodium is not available');
|
250 |
}
|
251 |
+
if (!\is_string($key)) {
|
252 |
throw new InvalidArgumentException('key must be a string when using EdDSA');
|
253 |
}
|
254 |
try {
|
301 |
'OpenSSL error: ' . \openssl_error_string()
|
302 |
);
|
303 |
case 'sodium_crypto':
|
304 |
+
if (!\function_exists('sodium_crypto_sign_verify_detached')) {
|
305 |
throw new DomainException('libsodium is not available');
|
306 |
}
|
307 |
+
if (!\is_string($keyMaterial)) {
|
308 |
throw new InvalidArgumentException('key must be a string when using EdDSA');
|
309 |
}
|
310 |
try {
|
317 |
}
|
318 |
case 'hash_hmac':
|
319 |
default:
|
320 |
+
if (!\is_string($keyMaterial)) {
|
321 |
throw new InvalidArgumentException('key must be a string when using hmac');
|
322 |
}
|
323 |
$hash = \hash_hmac($algorithm, $msg, $keyMaterial, true);
|
409 |
/**
|
410 |
* Determine if an algorithm has been provided for each Key
|
411 |
*
|
412 |
+
* @param Key|ArrayAccess<string,Key>|array<string,Key> $keyOrKeyArray
|
413 |
* @param string|null $kid
|
414 |
*
|
415 |
* @throws UnexpectedValueException
|
424 |
return $keyOrKeyArray;
|
425 |
}
|
426 |
|
427 |
+
if ($keyOrKeyArray instanceof CachedKeySet) {
|
428 |
+
// Skip "isset" check, as this will automatically refresh if not set
|
429 |
+
return $keyOrKeyArray[$kid];
|
|
|
|
|
|
|
|
|
430 |
}
|
431 |
+
|
432 |
+
if (empty($kid)) {
|
433 |
throw new UnexpectedValueException('"kid" empty, unable to lookup correct key');
|
434 |
}
|
435 |
if (!isset($keyOrKeyArray[$kid])) {
|
vendor/firebase/php-jwt/src/Key.php
CHANGED
@@ -2,10 +2,10 @@
|
|
2 |
|
3 |
namespace Firebase\JWT;
|
4 |
|
|
|
5 |
use OpenSSLAsymmetricKey;
|
6 |
use OpenSSLCertificate;
|
7 |
use TypeError;
|
8 |
-
use InvalidArgumentException;
|
9 |
|
10 |
class Key
|
11 |
{
|
@@ -23,10 +23,10 @@ class Key
|
|
23 |
string $algorithm
|
24 |
) {
|
25 |
if (
|
26 |
-
|
27 |
&& !$keyMaterial instanceof OpenSSLAsymmetricKey
|
28 |
&& !$keyMaterial instanceof OpenSSLCertificate
|
29 |
-
&&
|
30 |
) {
|
31 |
throw new TypeError('Key material must be a string, resource, or OpenSSLAsymmetricKey');
|
32 |
}
|
2 |
|
3 |
namespace Firebase\JWT;
|
4 |
|
5 |
+
use InvalidArgumentException;
|
6 |
use OpenSSLAsymmetricKey;
|
7 |
use OpenSSLCertificate;
|
8 |
use TypeError;
|
|
|
9 |
|
10 |
class Key
|
11 |
{
|
23 |
string $algorithm
|
24 |
) {
|
25 |
if (
|
26 |
+
!\is_string($keyMaterial)
|
27 |
&& !$keyMaterial instanceof OpenSSLAsymmetricKey
|
28 |
&& !$keyMaterial instanceof OpenSSLCertificate
|
29 |
+
&& !\is_resource($keyMaterial)
|
30 |
) {
|
31 |
throw new TypeError('Key material must be a string, resource, or OpenSSLAsymmetricKey');
|
32 |
}
|