VK All in One Expansion Unit - Version 9.70.2.0

Version Description

  • [ Bug fix ] fix active settingscreen about widget.
Download this release

Release Info

Developer kurudrive
Plugin Icon 128x128 VK All in One Expansion Unit
Version 9.70.2.0
Comparing to
See all releases

Code changes from version 9.70.1.0 to 9.70.2.0

assets/_js/master.js CHANGED
@@ -18,9 +18,12 @@
18
  body: '{"linkurl": "'+ location.href +'"}'
19
  }: { method: 'GET' }
20
 
 
 
 
21
  // hatena
22
  fetch(
23
- (vkExOpt.entry_from_post)? vkExOpt.hatena_entry : vkExOpt.hatena_entry + encodeURIComponent(location.href),
24
  param
25
  ).then((r)=>{
26
  if (r.ok) {
@@ -39,10 +42,11 @@
39
  .catch((x)=>{})
40
 
41
  // facebook
42
- let fb_elements = document.getElementsByClassName('veu_count_sns_fb')
 
43
  if(vkExOpt.facebook_count_enable) {
44
  fetch(
45
- (vkExOpt.entry_from_post)? vkExOpt.facebook_entry : vkExOpt.facebook_entry + encodeURIComponent(location.href),
46
  param
47
  ).then((r)=>{
48
  if (r.ok) {
18
  body: '{"linkurl": "'+ location.href +'"}'
19
  }: { method: 'GET' }
20
 
21
+ // Avoiding Apache config "AllowEncodedSlashes" option issue
22
+ let location_href_replaceslashes = location.href.replace(/\//g, '-#-');
23
+
24
  // hatena
25
  fetch(
26
+ (vkExOpt.entry_from_post)? vkExOpt.hatena_entry : vkExOpt.hatena_entry + encodeURIComponent(location_href_replaceslashes),
27
  param
28
  ).then((r)=>{
29
  if (r.ok) {
42
  .catch((x)=>{})
43
 
44
  // facebook
45
+ let fb_elements = document.getElementsByClassName('veu_count_sns_fb');
46
+
47
  if(vkExOpt.facebook_count_enable) {
48
  fetch(
49
+ (vkExOpt.entry_from_post)? vkExOpt.facebook_entry : vkExOpt.facebook_entry + encodeURIComponent(location_href_replaceslashes),
50
  param
51
  ).then((r)=>{
52
  if (r.ok) {
assets/js/all.min.js CHANGED
@@ -1 +1 @@
1
- "use strict";!function(t,n){t.addEventListener("load",function(){var o,t,e;!vkExOpt.entry_count||0!=(o=n.getElementsByClassName("veu_count_sns_hb")).length&&(t=vkExOpt.entry_from_post?{method:"POST",headers:{"Content-Type":"application/json; charset=utf-8"},body:'{"linkurl": "'+location.href+'"}'}:{method:"GET"},fetch(vkExOpt.entry_from_post?vkExOpt.hatena_entry:vkExOpt.hatena_entry+encodeURIComponent(location.href),t).then(function(t){t.ok&&t.json().then(function(n){void 0!==n.count&&Array.prototype.forEach.call(o,function(t){return t.innerHTML=n.count})})}).catch(function(t){}),e=n.getElementsByClassName("veu_count_sns_fb"),vkExOpt.facebook_count_enable&&fetch(vkExOpt.entry_from_post?vkExOpt.facebook_entry:vkExOpt.facebook_entry+encodeURIComponent(location.href),t).then(function(t){t.ok&&t.json().then(function(n){void 0!==n.count&&Array.prototype.forEach.call(e,function(t){return t.innerHTML=n.count})})}).catch(function(t){}))},!1)}(window,document),function(t,n,o){t.addEventListener("scroll",function(){0<t.pageYOffset?n.body.classList.add(o):n.body.classList.remove(o)})}(window,document,"scrolled");
1
+ "use strict";!function(t,c){t.addEventListener("load",function(){var o,t,n,e;!vkExOpt.entry_count||0!=(o=c.getElementsByClassName("veu_count_sns_hb")).length&&(t=vkExOpt.entry_from_post?{method:"POST",headers:{"Content-Type":"application/json; charset=utf-8"},body:'{"linkurl": "'+location.href+'"}'}:{method:"GET"},n=location.href.replace(/\//g,"-#-"),fetch(vkExOpt.entry_from_post?vkExOpt.hatena_entry:vkExOpt.hatena_entry+encodeURIComponent(n),t).then(function(t){t.ok&&t.json().then(function(n){void 0!==n.count&&Array.prototype.forEach.call(o,function(t){return t.innerHTML=n.count})})}).catch(function(t){}),e=c.getElementsByClassName("veu_count_sns_fb"),vkExOpt.facebook_count_enable&&fetch(vkExOpt.entry_from_post?vkExOpt.facebook_entry:vkExOpt.facebook_entry+encodeURIComponent(n),t).then(function(t){t.ok&&t.json().then(function(n){void 0!==n.count&&Array.prototype.forEach.call(e,function(t){return t.innerHTML=n.count})})}).catch(function(t){}))},!1)}(window,document),function(t,n,o){t.addEventListener("scroll",function(){0<t.pageYOffset?n.body.classList.add(o):n.body.classList.remove(o)})}(window,document,"scrolled");
inc/other-widget/class-veu-other-widget-admin-control.php CHANGED
@@ -19,8 +19,8 @@ class VEU_Other_Widget_Admin_Control {
19
  */
20
  public function admin_config_validate( $output, $input, $defaults ) {
21
  $_v = array();
22
- // 有効化設定の $input['active_otherWidgets'] がちゃんと落ちてきたら動作するように変更
23
- if ( ! empty( $input['active_otherWidgets'] ) ) {
24
  // ウィジェットの有効化情報($input['enable_widgets'])がちゃんと落ちてきたら update 処理する
25
  if ( ! empty( $input['enable_widgets'] ) && is_array( $input['enable_widgets'] ) ) {
26
  foreach ( $input['enable_widgets'] as $v ) {
19
  */
20
  public function admin_config_validate( $output, $input, $defaults ) {
21
  $_v = array();
22
+ // 有効化設定の $_POST['vkExUnit_widget_setting'] がちゃんと落ちてきたら動作するように変更
23
+ if ( ! empty( $_POST['vkExUnit_widget_setting'] ) ) {
24
  // ウィジェットの有効化情報($input['enable_widgets'])がちゃんと落ちてきたら update 処理する
25
  if ( ! empty( $input['enable_widgets'] ) && is_array( $input['enable_widgets'] ) ) {
26
  foreach ( $input['enable_widgets'] as $v ) {
inc/other-widget/template/admin_setting.php CHANGED
@@ -3,6 +3,8 @@
3
  ?>
4
 
5
  <h2><?php echo __( 'Widget Enablation', 'vk-all-in-one-expansion-unit' ); ?></h2>
 
 
6
  <table id="widget_enablation" class="wp-list-table widefat plugins table-widget-enablation">
7
  <thead>
8
  <tr>
3
  ?>
4
 
5
  <h2><?php echo __( 'Widget Enablation', 'vk-all-in-one-expansion-unit' ); ?></h2>
6
+ <!-- ここでウィジェット設定が反映されたか判定 -->
7
+ <input type="hidden" name="vkExUnit_widget_setting" value="true">
8
  <table id="widget_enablation" class="wp-list-table widefat plugins table-widget-enablation">
9
  <thead>
10
  <tr>
inc/sns/function-sns-btns.php CHANGED
@@ -378,7 +378,7 @@ add_filter(
378
  $options['facebook_entry'] = get_rest_url( 0, 'vk_ex_unit/v1/facebook_entry/' );
379
  $options['facebook_count_enable'] = false;
380
  $options['entry_count'] = (bool) ( 'disable' !== $opt['entry_count'] );
381
- $options['entry_from_post'] = (bool) ( 'post' !== $opt['entry_count'] );
382
 
383
  $opt = veu_get_sns_options();
384
  if ( ! empty( $opt['fbAccessToken'] ) ) {
@@ -397,15 +397,20 @@ add_filter(
397
  * @return string api response
398
  */
399
  function vew_sns_hatena_restapi_callback( $data ) {
400
- $link_url = $data['linkurl'];
401
  $siteurl = get_site_url();
402
 
 
 
 
403
  if ( strpos( preg_replace( '/^https?:\/\//', '', $link_url ), preg_replace( '/^https?:\/\//', '', $siteurl ) ) < 0 ) {
404
  $response = new WP_REST_Response( array() );
405
  $response->set_status( 403 );
406
  return $response;
407
  }
408
 
 
 
409
  $r = wp_safe_remote_get( 'https://bookmark.hatenaapis.com/count/entry?url=' . $link_url );
410
 
411
  if ( ! is_wp_error( $r ) ) {
@@ -436,15 +441,20 @@ function vew_sns_hatena_restapi_callback( $data ) {
436
  * @return string api response
437
  */
438
  function vew_sns_facebook_restapi_callback( $data ) {
439
- $link_url = $data['linkurl'];
440
  $siteurl = get_site_url();
441
 
 
 
 
442
  if ( strpos( preg_replace( '/^https?:\/\//', '', $link_url ), preg_replace( '/^https?:\/\//', '', $siteurl ) ) < 0 ) {
443
  $response = new WP_REST_Response( array() );
444
  $response->set_status( 403 );
445
  return $response;
446
  }
447
 
 
 
448
  $options = veu_get_sns_options();
449
  if ( empty( $options['fbAccessToken'] ) ) {
450
  $response = new WP_REST_Response( array( 'errors' => array( 'Service Unavailable' ) ) );
378
  $options['facebook_entry'] = get_rest_url( 0, 'vk_ex_unit/v1/facebook_entry/' );
379
  $options['facebook_count_enable'] = false;
380
  $options['entry_count'] = (bool) ( 'disable' !== $opt['entry_count'] );
381
+ $options['entry_from_post'] = (bool) ( 'post' === $opt['entry_count'] );
382
 
383
  $opt = veu_get_sns_options();
384
  if ( ! empty( $opt['fbAccessToken'] ) ) {
397
  * @return string api response
398
  */
399
  function vew_sns_hatena_restapi_callback( $data ) {
400
+
401
  $siteurl = get_site_url();
402
 
403
+ // Avoiding Apache config "AllowEncodedSlashes" option issue
404
+ $link_url = str_replace( "-#-", "/", urldecode( $data['linkurl'] ) );
405
+
406
  if ( strpos( preg_replace( '/^https?:\/\//', '', $link_url ), preg_replace( '/^https?:\/\//', '', $siteurl ) ) < 0 ) {
407
  $response = new WP_REST_Response( array() );
408
  $response->set_status( 403 );
409
  return $response;
410
  }
411
 
412
+ $link_url = urlencode( $link_url );
413
+
414
  $r = wp_safe_remote_get( 'https://bookmark.hatenaapis.com/count/entry?url=' . $link_url );
415
 
416
  if ( ! is_wp_error( $r ) ) {
441
  * @return string api response
442
  */
443
  function vew_sns_facebook_restapi_callback( $data ) {
444
+
445
  $siteurl = get_site_url();
446
 
447
+ // Avoiding Apache config "AllowEncodedSlashes" option issue
448
+ $link_url = str_replace( "-#-", "/", urldecode( $data['linkurl'] ) );
449
+
450
  if ( strpos( preg_replace( '/^https?:\/\//', '', $link_url ), preg_replace( '/^https?:\/\//', '', $siteurl ) ) < 0 ) {
451
  $response = new WP_REST_Response( array() );
452
  $response->set_status( 403 );
453
  return $response;
454
  }
455
 
456
+ $link_url = urlencode( $link_url );
457
+
458
  $options = veu_get_sns_options();
459
  if ( empty( $options['fbAccessToken'] ) ) {
460
  $response = new WP_REST_Response( array( 'errors' => array( 'Service Unavailable' ) ) );
package-lock.json CHANGED
@@ -17997,9 +17997,9 @@
17997
  "optional": true
17998
  },
17999
  "nanoid": {
18000
- "version": "3.1.30",
18001
- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.30.tgz",
18002
- "integrity": "sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ==",
18003
  "dev": true
18004
  },
18005
  "nanomatch": {
17997
  "optional": true
17998
  },
17999
  "nanoid": {
18000
+ "version": "3.2.0",
18001
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz",
18002
+ "integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==",
18003
  "dev": true
18004
  },
18005
  "nanomatch": {
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: Google Analytics, New posts, Related Posts, sitemap, sns, twitter card, Fa
5
  Requires at least: 5.3.0
6
  Tested up to: 5.9.0
7
  Requires PHP: 7.0
8
- Stable tag: 9.70.1.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -82,6 +82,9 @@ e.g.
82
 
83
  == Changelog ==
84
 
 
 
 
85
  = 9.70.1.0 =
86
  * [ Bug fix ][ sitemap / page-list-from-ancesters / share ] Fix preview on WP5.9
87
 
5
  Requires at least: 5.3.0
6
  Tested up to: 5.9.0
7
  Requires PHP: 7.0
8
+ Stable tag: 9.70.2.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
82
 
83
  == Changelog ==
84
 
85
+ = 9.70.2.0 =
86
+ * [ Bug fix ] fix active settingscreen about widget.
87
+
88
  = 9.70.1.0 =
89
  * [ Bug fix ][ sitemap / page-list-from-ancesters / share ] Fix preview on WP5.9
90
 
vkExUnit.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: VK All in One Expansion Unit
4
  * Plugin URI: https://ex-unit.nagoya
5
  * Description: This plug-in is an integrated plug-in with a variety of features that make it powerful your web site. Many features can be stopped individually. Example Facebook Page Plugin,Social Bookmarks,Print OG Tags,Print Twitter Card Tags,Print Google Analytics tag,New post widget,Insert Related Posts and more!
6
- * Version: 9.70.1.0
7
  * Requires PHP: 7.0
8
  * Author: Vektor,Inc.
9
  * Text Domain: vk-all-in-one-expansion-unit
3
  * Plugin Name: VK All in One Expansion Unit
4
  * Plugin URI: https://ex-unit.nagoya
5
  * Description: This plug-in is an integrated plug-in with a variety of features that make it powerful your web site. Many features can be stopped individually. Example Facebook Page Plugin,Social Bookmarks,Print OG Tags,Print Twitter Card Tags,Print Google Analytics tag,New post widget,Insert Related Posts and more!
6
+ * Version: 9.70.2.0
7
  * Requires PHP: 7.0
8
  * Author: Vektor,Inc.
9
  * Text Domain: vk-all-in-one-expansion-unit