SNS Count Cache - Version 0.8.0

Version Description

  • Added: Japanese translation
  • Improved: Cache processing is stabilized.
  • Added: function to select feed type for feedly follower retrieval.

=

Download this release

Release Info

Developer marubon
Plugin Icon SNS Count Cache
Version 0.8.0
Comparing to
See all releases

Code changes from version 0.7.1 to 0.8.0

images/loading.gif CHANGED
Binary file
includes/admin-cache-status.php CHANGED
@@ -70,31 +70,31 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
70
 
71
  ?>
72
  <div class="wrap">
73
- <h2><a href="admin.php?page=scc-cache-status"><?php _e( 'SNS Count Cache', self::DOMAIN ) ?></a></h2>
74
  <div class="sns-cnt-cache">
75
  <h3 class="nav-tab-wrapper">
76
- <a class="nav-tab" href="admin.php?page=scc-dashboard"><?php _e( 'Dashboard', self::DOMAIN ) ?></a>
77
- <a class="nav-tab nav-tab-active" href="admin.php?page=scc-cache-status"><?php _e( 'Cache Status', self::DOMAIN ) ?></a>
78
- <a class="nav-tab" href="admin.php?page=scc-share-count"><?php _e( 'Share Count', self::DOMAIN ) ?></a>
79
  <?php if ( $this->share_variation_analysis_mode !== self::OPT_SHARE_VARIATION_ANALYSIS_NONE ) { ?>
80
- <a class="nav-tab" href="admin.php?page=scc-hot-content"><?php _e( 'Hot Content', self::DOMAIN ) ?></a>
81
  <?php } ?>
82
- <a class="nav-tab" href="admin.php?page=scc-setting"><?php _e( 'Setting', self::DOMAIN ) ?></a>
83
- <a class="nav-tab" href="admin.php?page=scc-help"><?php _e( 'Help', self::DOMAIN ) ?></a>
84
  </h3>
85
  <div class="metabox-holder">
86
  <div id="share-site-summary" class="postbox">
87
  <div class="handlediv" title="Click to toggle"><br></div>
88
- <h3 class="hndle"><span><?php _e( 'Cache Status', self::DOMAIN ) ?></span></h3>
89
  <div class="inside">
90
  <table class="view-table">
91
  <thead>
92
  <tr>
93
  <th>No.</th>
94
- <th><?php _e( 'Target Content', self::DOMAIN ) ?></th>
95
- <th><?php _e( 'Primary Cache', self::DOMAIN ) ?></th>
96
- <th><?php _e( 'Secondary Cache', self::DOMAIN ) ?></th>
97
- <th><?php _e( 'Crawl Date', self::DOMAIN ) ?></th>
98
  <th></th>
99
  </tr>
100
  </thead>
@@ -304,7 +304,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
304
  $nonce = wp_create_nonce( __FILE__ );
305
  $cache_url = esc_url( 'admin.php?page=scc-cache-status&action=cache&post_id=' . get_the_ID() . '&_wpnonce=' . $nonce . '&paged=' . $paged );
306
  ?>
307
- <td><a class="button" href="<?php echo $cache_url ?>">Cache</a></td>
308
  </tr>
309
 
310
  <?php
70
 
71
  ?>
72
  <div class="wrap">
73
+ <h2><a href="admin.php?page=scc-cache-status"><?php _e( 'SNS Count Cache', self::DOMAIN ); ?></a></h2>
74
  <div class="sns-cnt-cache">
75
  <h3 class="nav-tab-wrapper">
76
+ <a class="nav-tab" href="admin.php?page=scc-dashboard"><?php _e( 'Dashboard', self::DOMAIN ); ?></a>
77
+ <a class="nav-tab nav-tab-active" href="admin.php?page=scc-cache-status"><?php _e( 'Cache Status', self::DOMAIN ); ?></a>
78
+ <a class="nav-tab" href="admin.php?page=scc-share-count"><?php _e( 'Share Count', self::DOMAIN ); ?></a>
79
  <?php if ( $this->share_variation_analysis_mode !== self::OPT_SHARE_VARIATION_ANALYSIS_NONE ) { ?>
80
+ <a class="nav-tab" href="admin.php?page=scc-hot-content"><?php _e( 'Hot Content', self::DOMAIN ); ?></a>
81
  <?php } ?>
82
+ <a class="nav-tab" href="admin.php?page=scc-setting"><?php _e( 'Setting', self::DOMAIN ); ?></a>
83
+ <a class="nav-tab" href="admin.php?page=scc-help"><?php _e( 'Help', self::DOMAIN ); ?></a>
84
  </h3>
85
  <div class="metabox-holder">
86
  <div id="share-site-summary" class="postbox">
87
  <div class="handlediv" title="Click to toggle"><br></div>
88
+ <h3 class="hndle"><span><?php _e( 'Cache Status', self::DOMAIN ); ?></span></h3>
89
  <div class="inside">
90
  <table class="view-table">
91
  <thead>
92
  <tr>
93
  <th>No.</th>
94
+ <th><?php _e( 'Content', self::DOMAIN ); ?></th>
95
+ <th><?php _e( 'Primary Cache', self::DOMAIN ); ?></th>
96
+ <th><?php _e( 'Secondary Cache', self::DOMAIN ); ?></th>
97
+ <th><?php _e( 'Crawl Date', self::DOMAIN ); ?></th>
98
  <th></th>
99
  </tr>
100
  </thead>
304
  $nonce = wp_create_nonce( __FILE__ );
305
  $cache_url = esc_url( 'admin.php?page=scc-cache-status&action=cache&post_id=' . get_the_ID() . '&_wpnonce=' . $nonce . '&paged=' . $paged );
306
  ?>
307
+ <td><a class="button" href="<?php echo $cache_url ?>"><?php _e( 'Cache', self::DOMAIN ); ?></a></td>
308
  </tr>
309
 
310
  <?php
includes/admin-dashboard-widget.php CHANGED
@@ -44,16 +44,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
44
  <div class="sns-cnt-cache">
45
  <div id="scc-dashboard">
46
  <div id="site-summary-cache" class="site-summary">
47
- <h4><a href="admin.php?page=scc-cache-status"><?php _e( 'Cache Status', self::DOMAIN ) ?></a></h4>
48
  <table class="view-table">
49
  <thead>
50
  <tr>
51
- <th><?php _e( 'Cache Type', self::DOMAIN ) ?></th>
52
- <th><?php _e( 'Status Overview', self::DOMAIN ) ?></th>
53
- <th><?php _e( 'Total Content', self::DOMAIN ) ?></th>
54
- <th><?php _e( 'State - Full Cache', self::DOMAIN ) ?></th>
55
- <th><?php _e( 'State - Partial Cache', self::DOMAIN ) ?></th>
56
- <th><?php _e( 'State - No Cache', self::DOMAIN ) ?></th>
57
  </tr>
58
  </thead>
59
  <tbody>
@@ -81,7 +81,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
81
  </table>
82
  </div>
83
  <div id="site-summary-count" class="site-summary">
84
- <h4><a href="admin.php?page=scc-share-count"><?php _e( 'Share Count', self::DOMAIN ) ?></a></h4>
85
  <table class="view-table">
86
  <thead>
87
  <tr>
@@ -91,7 +91,31 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
91
 
92
  foreach ( $share_base_cache_target as $sns => $active ){
93
  if ( $active ) {
94
- echo '<th>' . $sns . '</th>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  }
96
  }
97
  ?>
44
  <div class="sns-cnt-cache">
45
  <div id="scc-dashboard">
46
  <div id="site-summary-cache" class="site-summary">
47
+ <h4><a href="admin.php?page=scc-cache-status"><?php _e( 'Cache Status', self::DOMAIN ); ?></a></h4>
48
  <table class="view-table">
49
  <thead>
50
  <tr>
51
+ <th><?php _e( 'Cache Type', self::DOMAIN ); ?></th>
52
+ <th><?php _e( 'Cache Progress', self::DOMAIN ); ?></th>
53
+ <th><?php _e( 'Total Content', self::DOMAIN ); ?></th>
54
+ <th><?php _e( 'State - Full Cache', self::DOMAIN ); ?></th>
55
+ <th><?php _e( 'State - Partial Cache', self::DOMAIN ); ?></th>
56
+ <th><?php _e( 'State - No Cache', self::DOMAIN ); ?></th>
57
  </tr>
58
  </thead>
59
  <tbody>
81
  </table>
82
  </div>
83
  <div id="site-summary-count" class="site-summary">
84
+ <h4><a href="admin.php?page=scc-share-count"><?php _e( 'Share Count', self::DOMAIN ); ?></a></h4>
85
  <table class="view-table">
86
  <thead>
87
  <tr>
91
 
92
  foreach ( $share_base_cache_target as $sns => $active ){
93
  if ( $active ) {
94
+
95
+ $sns_name = '';
96
+
97
+ switch ( $sns ) {
98
+ case self::REF_SHARE_TWITTER:
99
+ $sns_name = __( 'Twitter', self::DOMAIN );
100
+ break;
101
+ case self::REF_SHARE_FACEBOOK:
102
+ $sns_name = __( 'Facebook', self::DOMAIN );
103
+ break;
104
+ case self::REF_SHARE_GPLUS:
105
+ $sns_name = __( 'Google+', self::DOMAIN );
106
+ break;
107
+ case self::REF_SHARE_POCKET:
108
+ $sns_name = __( 'Pocket', self::DOMAIN );
109
+ break;
110
+ case self::REF_SHARE_HATEBU:
111
+ $sns_name = __( 'Hatebu', self::DOMAIN );
112
+ break;
113
+ case self::REF_SHARE_TOTAL:
114
+ $sns_name = __( 'Total', self::DOMAIN );
115
+ break;
116
+ }
117
+
118
+ echo '<th>' . esc_html( $sns_name ) . '</th>';
119
  }
120
  }
121
  ?>
includes/admin-dashboard.php CHANGED
@@ -41,34 +41,34 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
41
 
42
  ?>
43
  <div class="wrap">
44
- <h2><a href="admin.php?page=scc-dashboard"><?php _e( 'SNS Count Cache', self::DOMAIN ) ?></a></h2>
45
  <div class="sns-cnt-cache">
46
  <div id="scc-dashboard">
47
  <h3 class="nav-tab-wrapper">
48
- <a class="nav-tab nav-tab-active" href="admin.php?page=scc-dashboard"><?php _e( 'Dashboard', self::DOMAIN ) ?></a>
49
- <a class="nav-tab" href="admin.php?page=scc-cache-status"><?php _e( 'Cache Status', self::DOMAIN ) ?></a>
50
- <a class="nav-tab" href="admin.php?page=scc-share-count"><?php _e( 'Share Count', self::DOMAIN ) ?></a>
51
  <?php if ( $this->share_variation_analysis_mode !== self::OPT_SHARE_VARIATION_ANALYSIS_NONE ) { ?>
52
- <a class="nav-tab" href="admin.php?page=scc-hot-content"><?php _e( 'Hot Content', self::DOMAIN ) ?></a>
53
  <?php } ?>
54
- <a class="nav-tab" href="admin.php?page=scc-setting"><?php _e( 'Setting', self::DOMAIN ) ?></a>
55
- <a class="nav-tab" href="admin.php?page=scc-help"><?php _e( 'Help', self::DOMAIN ) ?></a>
56
  </h3>
57
 
58
  <div class="metabox-holder">
59
  <div id="site-summary-cache" class="site-summary postbox">
60
  <div class="handlediv" title="Click to toggle"><br></div>
61
- <h3 class="hndle"><span><?php _e( 'Cache Status', self::DOMAIN ) ?></span></h3>
62
  <div class="inside">
63
  <table class="view-table">
64
  <thead>
65
  <tr>
66
- <th><?php _e( 'Cache Type', self::DOMAIN ) ?></th>
67
- <th><?php _e( 'Status Overview', self::DOMAIN ) ?></th>
68
- <th><?php _e( 'Total Content', self::DOMAIN ) ?></th>
69
- <th><?php _e( 'State - Full Cache', self::DOMAIN ) ?></th>
70
- <th><?php _e( 'State - Partial Cache', self::DOMAIN ) ?></th>
71
- <th><?php _e( 'State - No Cache', self::DOMAIN ) ?></th>
72
  </tr>
73
  </thead>
74
  <tbody>
@@ -101,7 +101,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
101
  <div class="metabox-holder">
102
  <div id="site-summary-count" class="site-summary postbox">
103
  <div class="handlediv" title="Click to toggle"><br></div>
104
- <h3 class="hndle"><span><?php _e( 'Share Count', self::DOMAIN ) ?></span></h3>
105
  <div class="inside">
106
  <table class="view-table">
107
  <thead>
@@ -112,7 +112,31 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
112
 
113
  foreach ( $share_base_cache_target as $sns => $active ){
114
  if ( $active ) {
115
- echo '<th>' . $sns . '</th>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  }
117
  }
118
  ?>
41
 
42
  ?>
43
  <div class="wrap">
44
+ <h2><a href="admin.php?page=scc-dashboard"><?php _e( 'SNS Count Cache', self::DOMAIN ); ?></a></h2>
45
  <div class="sns-cnt-cache">
46
  <div id="scc-dashboard">
47
  <h3 class="nav-tab-wrapper">
48
+ <a class="nav-tab nav-tab-active" href="admin.php?page=scc-dashboard"><?php _e( 'Dashboard', self::DOMAIN ); ?></a>
49
+ <a class="nav-tab" href="admin.php?page=scc-cache-status"><?php _e( 'Cache Status', self::DOMAIN ); ?></a>
50
+ <a class="nav-tab" href="admin.php?page=scc-share-count"><?php _e( 'Share Count', self::DOMAIN ); ?></a>
51
  <?php if ( $this->share_variation_analysis_mode !== self::OPT_SHARE_VARIATION_ANALYSIS_NONE ) { ?>
52
+ <a class="nav-tab" href="admin.php?page=scc-hot-content"><?php _e( 'Hot Content', self::DOMAIN ); ?></a>
53
  <?php } ?>
54
+ <a class="nav-tab" href="admin.php?page=scc-setting"><?php _e( 'Setting', self::DOMAIN ); ?></a>
55
+ <a class="nav-tab" href="admin.php?page=scc-help"><?php _e( 'Help', self::DOMAIN ); ?></a>
56
  </h3>
57
 
58
  <div class="metabox-holder">
59
  <div id="site-summary-cache" class="site-summary postbox">
60
  <div class="handlediv" title="Click to toggle"><br></div>
61
+ <h3 class="hndle"><span><?php _e( 'Cache Status', self::DOMAIN ); ?></span></h3>
62
  <div class="inside">
63
  <table class="view-table">
64
  <thead>
65
  <tr>
66
+ <th><?php _e( 'Cache Type', self::DOMAIN ); ?></th>
67
+ <th><?php _e( 'Cache Progress', self::DOMAIN ); ?></th>
68
+ <th><?php _e( 'Total Content', self::DOMAIN ); ?></th>
69
+ <th><?php _e( 'State - Full Cache', self::DOMAIN ); ?></th>
70
+ <th><?php _e( 'State - Partial Cache', self::DOMAIN ); ?></th>
71
+ <th><?php _e( 'State - No Cache', self::DOMAIN ); ?></th>
72
  </tr>
73
  </thead>
74
  <tbody>
101
  <div class="metabox-holder">
102
  <div id="site-summary-count" class="site-summary postbox">
103
  <div class="handlediv" title="Click to toggle"><br></div>
104
+ <h3 class="hndle"><span><?php _e( 'Share Count', self::DOMAIN ); ?></span></h3>
105
  <div class="inside">
106
  <table class="view-table">
107
  <thead>
112
 
113
  foreach ( $share_base_cache_target as $sns => $active ){
114
  if ( $active ) {
115
+
116
+ $sns_name = '';
117
+
118
+ switch ( $sns ) {
119
+ case self::REF_SHARE_TWITTER:
120
+ $sns_name = __( 'Twitter', self::DOMAIN );
121
+ break;
122
+ case self::REF_SHARE_FACEBOOK:
123
+ $sns_name = __( 'Facebook', self::DOMAIN );
124
+ break;
125
+ case self::REF_SHARE_GPLUS:
126
+ $sns_name = __( 'Google+', self::DOMAIN );
127
+ break;
128
+ case self::REF_SHARE_POCKET:
129
+ $sns_name = __( 'Pocket', self::DOMAIN );
130
+ break;
131
+ case self::REF_SHARE_HATEBU:
132
+ $sns_name = __( 'Hatebu', self::DOMAIN );
133
+ break;
134
+ case self::REF_SHARE_TOTAL:
135
+ $sns_name = __( 'Total', self::DOMAIN );
136
+ break;
137
+ }
138
+
139
+ echo '<th>' . esc_html( $sns_name ) . '</th>';
140
  }
141
  }
142
  ?>
includes/admin-help.php CHANGED
@@ -32,66 +32,66 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
32
  ?>
33
 
34
  <div class="wrap">
35
- <h2><a href="admin.php?page=scc-help"><?php _e( 'SNS Count Cache', self::DOMAIN ) ?></a></h2>
36
  <div class="sns-cnt-cache">
37
 
38
  <h3 class="nav-tab-wrapper">
39
- <a class="nav-tab" href="admin.php?page=scc-dashboard"><?php _e( 'Dashboard', self::DOMAIN ) ?></a>
40
- <a class="nav-tab" href="admin.php?page=scc-cache-status"><?php _e( 'Cache Status', self::DOMAIN ) ?></a>
41
- <a class="nav-tab" href="admin.php?page=scc-share-count"><?php _e( 'Share Count', self::DOMAIN ) ?></a>
42
  <?php if ( $this->share_variation_analysis_mode !== self::OPT_SHARE_VARIATION_ANALYSIS_NONE ) { ?>
43
- <a class="nav-tab" href="admin.php?page=scc-hot-content"><?php _e( 'Hot Content', self::DOMAIN ) ?></a>
44
  <?php } ?>
45
  <a class="nav-tab" href="admin.php?page=scc-setting"><?php _e( 'Setting', self::DOMAIN ) ?></a>
46
- <a class="nav-tab nav-tab-active" href="admin.php?page=scc-help"><?php _e( 'Help', self::DOMAIN ) ?></a>
47
  </h3>
48
 
49
  <div class="metabox-holder">
50
  <div id="share-site-summary" class="postbox">
51
  <div class="handlediv" title="Click to toggle"><br></div>
52
- <h3 class="hndle"><span><?php _e( 'Help', self::DOMAIN ) ?></span></h3>
53
  <div class="inside">
54
 
55
 
56
- <h4><?php _e( 'What is SNS Cout Cache?', self::DOMAIN ) ?></h4>
57
- <p><?php _e( 'SNS Count Cache gets share count for Twitter and Facebook, Google Plus, Hatena Bookmark and caches these count in the background. This plugin may help you to shorten page loading time because the share count can be retrieved not through network but through the cache using given functions.', self::DOMAIN ) ?></p>
58
- <h4><?php _e( 'How often does this plugin get and cache share count?', self::DOMAIN) ?></h4>
59
- <p><?php _e( 'Although this plugin gets share count of 20 posts at a time every 10 minutes by default, you can modify the setting in the "Setting" tab in the setting page.', self::DOMAIN ) ?></p>
60
- <h4><?php _e( 'How can I know whether share count of each post is cached or not?', self::DOMAIN) ?></h4>
61
- <p><?php _e( 'Cache status is described in the "Cache Status" tab in the setting page.', self::DOMAIN ) ?></p>
62
- <h4><?php _e( 'How can I get share count from the cache?', self::DOMAIN) ?></h4>
63
- <p><?php _e( 'The share count is retrieved from the cache using the following functions in the WordPress loop such as query_posts(), get_posts() and WP_Query().', self::DOMAIN ) ?></p>
64
  <table class="view-table">
65
  <thead>
66
  <tr>
67
- <th><?php _e( 'Function', self::DOMAIN ) ?></th>
68
- <th><?php _e( 'Description', self::DOMAIN ) ?></th>
69
  </tr>
70
  </thead>
71
  <tbody>
72
- <tr><td>scc_get_share_twitter()</td><td><?php _e( 'Twitter share count is returned from cache.', self::DOMAIN ) ?></td></tr>
73
- <tr><td>scc_get_share_facebook()</td><td><?php _e( 'Facebook share count is returned from cache.', self::DOMAIN ) ?></td></tr>
74
- <tr><td>scc_get_share_gplus()</td><td><?php _e( 'Google Plus share count is returned from cache.', self::DOMAIN ) ?></td></tr>
75
- <tr><td>scc_get_share_hatebu()</td><td><?php _e( 'Hatena Bookmark share count is returned from cache.', self::DOMAIN ) ?></td></tr>
76
- <tr><td>scc_get_share_pocket()</td><td><?php _e( 'Pocket share count is returned from cache.', self::DOMAIN ) ?></td></tr>
77
- <tr><td>scc_get_share_total()</td><td><?php _e( 'Total share count of selected SNS is returned from cache.', self::DOMAIN ) ?></td></tr>
78
  </tbody>
79
  </table>
80
- <h4><?php _e( 'How can I get follow count from the cache?', self::DOMAIN) ?></h4>
81
- <p><?php _e( 'The follow count is retrieved from the cache using the following functions.', self::DOMAIN ) ?></p>
82
  <table class="view-table">
83
  <thead>
84
  <tr>
85
- <th><?php _e( 'Function', self::DOMAIN ) ?></th>
86
- <th><?php _e( 'Description', self::DOMAIN ) ?></th>
87
  </tr>
88
  </thead>
89
  <tbody>
90
- <tr><td>scc_get_follow_feedly()</td><td><?php _e( 'Feedly follow count is returned from cache.', self::DOMAIN ) ?></td></tr>
91
  </tbody>
92
  </table>
93
- <h4><?php _e( 'Example Code', self::DOMAIN ) ?></h4>
94
- <?php _e( 'The code below describes a simple example which displays share count and follower count using the above functions for each post.', self::DOMAIN ) ?>
95
  <pre class="prettyprint">&lt;?php
96
  $query_args = array(
97
  &#039;post_type&#039; =&gt; &#039;post&#039;,
@@ -133,40 +133,40 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
133
  }
134
  wp_reset_postdata();
135
  ?&gt;</pre>
136
- <h4><?php _e( 'How can I access specific custom field containing each share count?', self::DOMAIN) ?></h4>
137
- <p><?php _e( 'Custom fields including share count are accessed using the following meta keys.', self::DOMAIN ) ?></p>
138
  <table class="view-table">
139
  <thead>
140
  <tr>
141
- <th><?php _e( 'Meta Key', self::DOMAIN ) ?></th>
142
- <th><?php _e( 'Description', self::DOMAIN ) ?></th>
143
  </tr>
144
  </thead>
145
  <tbody>
146
- <tr><td>scc_share_count_twitter</td><td><?php _e( 'A meta key for Twitter share count', self::DOMAIN ) ?></td></tr>
147
- <tr><td>scc_share_count_facebook</td><td><?php _e( 'A meta key for Facebook share count', self::DOMAIN ) ?></td></tr>
148
- <tr><td>scc_share_count_google+</td><td><?php _e( 'A meta key for Google Plus share count', self::DOMAIN ) ?></td></tr>
149
- <tr><td>scc_share_count_hatebu</td><td><?php _e( 'A meta key for Hatena Bookmark share count', self::DOMAIN ) ?></td></tr>
150
- <tr><td>scc_share_count_pocket</td><td><?php _e( 'A meta key for Pocket share count', self::DOMAIN ) ?></td></tr>
151
- <tr><td>scc_share_count_total</td><td><?php _e( 'A meta key for total share count', self::DOMAIN ) ?></td></tr>
152
  </tbody>
153
  </table>
154
- <h4><?php _e( 'How can I access specific custom field containing each variation of share count?', self::DOMAIN) ?></h4>
155
- <p><?php _e( 'Custom fields including variation of share count are accessed using the following meta keys.', self::DOMAIN ) ?></p>
156
  <table class="view-table">
157
  <thead>
158
  <tr>
159
- <th><?php _e( 'Meta Key', self::DOMAIN ) ?></th>
160
- <th><?php _e( 'Description', self::DOMAIN ) ?></th>
161
  </tr>
162
  </thead>
163
  <tbody>
164
- <tr><td>scc_share_delta_twitter</td><td><?php _e( 'A meta key for variation of Twitter share count', self::DOMAIN ) ?></td></tr>
165
- <tr><td>scc_share_delta_facebook</td><td><?php _e( 'A meta key for variation of Facebook share count', self::DOMAIN ) ?></td></tr>
166
- <tr><td>scc_share_delta_google+</td><td><?php _e( 'A meta key for variation of Google Plus share count', self::DOMAIN ) ?></td></tr>
167
- <tr><td>scc_share_delta_hatebu</td><td><?php _e( 'A meta key for variation of Hatena Bookmark share count', self::DOMAIN ) ?></td></tr>
168
- <tr><td>scc_share_delta_pocket</td><td><?php _e( 'A meta key for variation of Pocket share count', self::DOMAIN ) ?></td></tr>
169
- <tr><td>scc_share_delta_total</td><td><?php _e( 'A meta key for variation of total share count', self::DOMAIN ) ?></td></tr>
170
  </tbody>
171
  </table>
172
  </div>
32
  ?>
33
 
34
  <div class="wrap">
35
+ <h2><a href="admin.php?page=scc-help"><?php _e( 'SNS Count Cache', self::DOMAIN ); ?></a></h2>
36
  <div class="sns-cnt-cache">
37
 
38
  <h3 class="nav-tab-wrapper">
39
+ <a class="nav-tab" href="admin.php?page=scc-dashboard"><?php _e( 'Dashboard', self::DOMAIN ); ?></a>
40
+ <a class="nav-tab" href="admin.php?page=scc-cache-status"><?php _e( 'Cache Status', self::DOMAIN ); ?></a>
41
+ <a class="nav-tab" href="admin.php?page=scc-share-count"><?php _e( 'Share Count', self::DOMAIN ); ?></a>
42
  <?php if ( $this->share_variation_analysis_mode !== self::OPT_SHARE_VARIATION_ANALYSIS_NONE ) { ?>
43
+ <a class="nav-tab" href="admin.php?page=scc-hot-content"><?php _e( 'Hot Content', self::DOMAIN ); ?></a>
44
  <?php } ?>
45
  <a class="nav-tab" href="admin.php?page=scc-setting"><?php _e( 'Setting', self::DOMAIN ) ?></a>
46
+ <a class="nav-tab nav-tab-active" href="admin.php?page=scc-help"><?php _e( 'Help', self::DOMAIN ); ?></a>
47
  </h3>
48
 
49
  <div class="metabox-holder">
50
  <div id="share-site-summary" class="postbox">
51
  <div class="handlediv" title="Click to toggle"><br></div>
52
+ <h3 class="hndle"><span><?php _e( 'Help', self::DOMAIN ); ?></span></h3>
53
  <div class="inside">
54
 
55
 
56
+ <h4><?php _e( 'What is WordPress plugin SNS Cout Cache?', self::DOMAIN ); ?></h4>
57
+ <p><?php _e( 'WordPress plugin SNS Count Cache is a plugin whitch helps you to shorten page loading time when you display share counts. This plugin gets share count for Twitter and Facebook, Google Plus, Pocket, Hatena Bookmark and caches these count in the background. The share count can be retrieved not through network but through the cache using given functions.', self::DOMAIN ); ?></p>
58
+ <h4><?php _e( 'How often does this plugin get and cache share counts?', self::DOMAIN ); ?></h4>
59
+ <p><?php _e( 'Although this plugin gets share count of 20 posts at a time every 10 minutes by default, you can modify the setting in the "Setting" tab in the administration page.', self::DOMAIN ); ?></p>
60
+ <h4><?php _e( 'How can I know whether share count of each post is cached or not?', self::DOMAIN ); ?></h4>
61
+ <p><?php _e( 'Cache status is described in the "Cache Status" tab in the administration page.', self::DOMAIN ); ?></p>
62
+ <h4><?php _e( 'How can I get share count from the cache?', self::DOMAIN ); ?></h4>
63
+ <p><?php _e( 'The share count is retrieved from the cache using the following functions in the WordPress loop such as query_posts(), get_posts() and WP_Query().', self::DOMAIN ); ?></p>
64
  <table class="view-table">
65
  <thead>
66
  <tr>
67
+ <th><?php _e( 'Function', self::DOMAIN ); ?></th>
68
+ <th><?php _e( 'Description', self::DOMAIN ); ?></th>
69
  </tr>
70
  </thead>
71
  <tbody>
72
+ <tr><td>scc_get_share_twitter()</td><td><?php _e( 'Twitter share count is returned from cache.', self::DOMAIN ); ?></td></tr>
73
+ <tr><td>scc_get_share_facebook()</td><td><?php _e( 'Facebook share count is returned from cache.', self::DOMAIN ); ?></td></tr>
74
+ <tr><td>scc_get_share_gplus()</td><td><?php _e( 'Google Plus share count is returned from cache.', self::DOMAIN ); ?></td></tr>
75
+ <tr><td>scc_get_share_hatebu()</td><td><?php _e( 'Hatena Bookmark share count is returned from cache.', self::DOMAIN ); ?></td></tr>
76
+ <tr><td>scc_get_share_pocket()</td><td><?php _e( 'Pocket share count is returned from cache.', self::DOMAIN ); ?></td></tr>
77
+ <tr><td>scc_get_share_total()</td><td><?php _e( 'Total share count of selected SNS is returned from cache.', self::DOMAIN ); ?></td></tr>
78
  </tbody>
79
  </table>
80
+ <h4><?php _e( 'How can I get follow count from the cache?', self::DOMAIN ); ?></h4>
81
+ <p><?php _e( 'The follow count is retrieved from the cache using the following functions.', self::DOMAIN ); ?></p>
82
  <table class="view-table">
83
  <thead>
84
  <tr>
85
+ <th><?php _e( 'Function', self::DOMAIN ); ?></th>
86
+ <th><?php _e( 'Description', self::DOMAIN ); ?></th>
87
  </tr>
88
  </thead>
89
  <tbody>
90
+ <tr><td>scc_get_follow_feedly()</td><td><?php _e( 'Feedly follow count is returned from cache.', self::DOMAIN ); ?></td></tr>
91
  </tbody>
92
  </table>
93
+ <h4><?php _e( 'Example Code', self::DOMAIN ); ?></h4>
94
+ <?php _e( 'The code below describes a simple example which displays share count and follower count using the above functions for each post.', self::DOMAIN ); ?>
95
  <pre class="prettyprint">&lt;?php
96
  $query_args = array(
97
  &#039;post_type&#039; =&gt; &#039;post&#039;,
133
  }
134
  wp_reset_postdata();
135
  ?&gt;</pre>
136
+ <h4><?php _e( 'How can I access specific custom field containing each share count?', self::DOMAIN ); ?></h4>
137
+ <p><?php _e( 'Custom fields including share count are accessed using the following meta keys.', self::DOMAIN ); ?></p>
138
  <table class="view-table">
139
  <thead>
140
  <tr>
141
+ <th><?php _e( 'Meta Key', self::DOMAIN ); ?></th>
142
+ <th><?php _e( 'Description', self::DOMAIN ); ?></th>
143
  </tr>
144
  </thead>
145
  <tbody>
146
+ <tr><td>scc_share_count_twitter</td><td><?php _e( 'A meta key for Twitter share count', self::DOMAIN ); ?></td></tr>
147
+ <tr><td>scc_share_count_facebook</td><td><?php _e( 'A meta key for Facebook share count', self::DOMAIN ); ?></td></tr>
148
+ <tr><td>scc_share_count_google+</td><td><?php _e( 'A meta key for Google Plus share count', self::DOMAIN ); ?></td></tr>
149
+ <tr><td>scc_share_count_hatebu</td><td><?php _e( 'A meta key for Hatena Bookmark share count', self::DOMAIN ); ?></td></tr>
150
+ <tr><td>scc_share_count_pocket</td><td><?php _e( 'A meta key for Pocket share count', self::DOMAIN ); ?></td></tr>
151
+ <tr><td>scc_share_count_total</td><td><?php _e( 'A meta key for total share count', self::DOMAIN ); ?></td></tr>
152
  </tbody>
153
  </table>
154
+ <h4><?php _e( 'How can I access specific custom field containing each variation of share count?', self::DOMAIN ); ?></h4>
155
+ <p><?php _e( 'Custom fields including variation of share count are accessed using the following meta keys.', self::DOMAIN ); ?></p>
156
  <table class="view-table">
157
  <thead>
158
  <tr>
159
+ <th><?php _e( 'Meta Key', self::DOMAIN ); ?></th>
160
+ <th><?php _e( 'Description', self::DOMAIN ); ?></th>
161
  </tr>
162
  </thead>
163
  <tbody>
164
+ <tr><td>scc_share_delta_twitter</td><td><?php _e( 'A meta key for variation of Twitter share count', self::DOMAIN ); ?></td></tr>
165
+ <tr><td>scc_share_delta_facebook</td><td><?php _e( 'A meta key for variation of Facebook share count', self::DOMAIN ); ?></td></tr>
166
+ <tr><td>scc_share_delta_google+</td><td><?php _e( 'A meta key for variation of Google Plus share count', self::DOMAIN ); ?></td></tr>
167
+ <tr><td>scc_share_delta_hatebu</td><td><?php _e( 'A meta key for variation of Hatena Bookmark share count', self::DOMAIN ); ?></td></tr>
168
+ <tr><td>scc_share_delta_pocket</td><td><?php _e( 'A meta key for variation of Pocket share count', self::DOMAIN ); ?></td></tr>
169
+ <tr><td>scc_share_delta_total</td><td><?php _e( 'A meta key for variation of total share count', self::DOMAIN ); ?></td></tr>
170
  </tbody>
171
  </table>
172
  </div>
includes/admin-hot-content.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- admin-share-count.php
4
 
5
  Description: Option page implementation
6
  Author: Daisuke Maruyama
@@ -67,26 +67,26 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
67
 
68
  ?>
69
  <div class="wrap">
70
- <h2><a href="admin.php?page=scc-hot-content"><?php _e( 'SNS Count Cache', self::DOMAIN ) ?></a></h2>
71
  <div class="sns-cnt-cache">
72
  <h3 class="nav-tab-wrapper">
73
- <a class="nav-tab" href="admin.php?page=scc-dashboard"><?php _e( 'Dashboard', self::DOMAIN ) ?></a>
74
- <a class="nav-tab" href="admin.php?page=scc-cache-status"><?php _e( 'Cache Status', self::DOMAIN ) ?></a>
75
- <a class="nav-tab" href="admin.php?page=scc-share-count"><?php _e( 'Share Count', self::DOMAIN ) ?></a>
76
- <a class="nav-tab nav-tab-active" href="admin.php?page=scc-hot-content"><?php _e( 'Hot Content', self::DOMAIN ) ?></a>
77
- <a class="nav-tab" href="admin.php?page=scc-setting"><?php _e( 'Setting', self::DOMAIN ) ?></a>
78
- <a class="nav-tab" href="admin.php?page=scc-help"><?php _e( 'Help', self::DOMAIN ) ?></a>
79
  </h3>
80
  <div class="metabox-holder">
81
  <div id="share-each-content" class="postbox">
82
  <div class="handlediv" title="Click to toggle"><br></div>
83
- <h3 class="hndle"><span><?php _e( 'Hot Content', self::DOMAIN ) ?></span></h3>
84
  <div class="inside">
85
  <table class="view-table">
86
  <thead>
87
  <tr>
88
  <th>No.</th>
89
- <th><?php _e( 'Content', self::DOMAIN ) ?></th>
90
  <?php
91
 
92
  foreach ( $share_base_cache_target as $sns => $active ) {
@@ -100,11 +100,34 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
100
  }
101
 
102
  $sort_url = esc_url( 'admin.php?page=scc-hot-content&action=sort&key=' . $sort_key );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
 
104
  if ( $sns === $sort_exec_key ){
105
- echo '<th><a class="sort-exec-key" href="' . $sort_url . '">' . esc_html( $sns ) . '</th>';
106
  } else {
107
- echo '<th><a href="' . $sort_url . '">' . esc_html( $sns ) . '</th>';
108
  }
109
  }
110
  }
1
  <?php
2
  /*
3
+ admin-hot-content.php
4
 
5
  Description: Option page implementation
6
  Author: Daisuke Maruyama
67
 
68
  ?>
69
  <div class="wrap">
70
+ <h2><a href="admin.php?page=scc-hot-content"><?php _e( 'SNS Count Cache', self::DOMAIN ); ?></a></h2>
71
  <div class="sns-cnt-cache">
72
  <h3 class="nav-tab-wrapper">
73
+ <a class="nav-tab" href="admin.php?page=scc-dashboard"><?php _e( 'Dashboard', self::DOMAIN ); ?></a>
74
+ <a class="nav-tab" href="admin.php?page=scc-cache-status"><?php _e( 'Cache Status', self::DOMAIN ); ?></a>
75
+ <a class="nav-tab" href="admin.php?page=scc-share-count"><?php _e( 'Share Count', self::DOMAIN ); ?></a>
76
+ <a class="nav-tab nav-tab-active" href="admin.php?page=scc-hot-content"><?php _e( 'Hot Content', self::DOMAIN ); ?></a>
77
+ <a class="nav-tab" href="admin.php?page=scc-setting"><?php _e( 'Setting', self::DOMAIN ); ?></a>
78
+ <a class="nav-tab" href="admin.php?page=scc-help"><?php _e( 'Help', self::DOMAIN ); ?></a>
79
  </h3>
80
  <div class="metabox-holder">
81
  <div id="share-each-content" class="postbox">
82
  <div class="handlediv" title="Click to toggle"><br></div>
83
+ <h3 class="hndle"><span><?php _e( 'Hot Content', self::DOMAIN ); ?></span></h3>
84
  <div class="inside">
85
  <table class="view-table">
86
  <thead>
87
  <tr>
88
  <th>No.</th>
89
+ <th><?php _e( 'Content', self::DOMAIN ); ?></th>
90
  <?php
91
 
92
  foreach ( $share_base_cache_target as $sns => $active ) {
100
  }
101
 
102
  $sort_url = esc_url( 'admin.php?page=scc-hot-content&action=sort&key=' . $sort_key );
103
+
104
+ $sns_name = '';
105
+
106
+ switch ( $sns ) {
107
+ case self::REF_SHARE_TWITTER:
108
+ $sns_name = __( 'Twitter', self::DOMAIN );
109
+ break;
110
+ case self::REF_SHARE_FACEBOOK:
111
+ $sns_name = __( 'Facebook', self::DOMAIN );
112
+ break;
113
+ case self::REF_SHARE_GPLUS:
114
+ $sns_name = __( 'Google+', self::DOMAIN );
115
+ break;
116
+ case self::REF_SHARE_POCKET:
117
+ $sns_name = __( 'Pocket', self::DOMAIN );
118
+ break;
119
+ case self::REF_SHARE_HATEBU:
120
+ $sns_name = __( 'Hatebu', self::DOMAIN );
121
+ break;
122
+ case self::REF_SHARE_TOTAL:
123
+ $sns_name = __( 'Total', self::DOMAIN );
124
+ break;
125
+ }
126
 
127
  if ( $sns === $sort_exec_key ){
128
+ echo '<th><a class="sort-exec-key" href="' . $sort_url . '">' . esc_html( $sns_name ) . '</th>';
129
  } else {
130
+ echo '<th><a href="' . $sort_url . '">' . esc_html( $sns_name ) . '</th>';
131
  }
132
  }
133
  }
includes/admin-setting.php CHANGED
@@ -146,6 +146,31 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
146
  $settings[self::DB_FOLLOW_CACHE_TARGET] = $follow_base_cache_target;
147
  }
148
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  if ( isset( $_POST["scheme_migration_mode"] ) && $_POST["scheme_migration_mode"] ) {
150
  $settings[self::DB_COMMON_SCHEME_MIGRATION_MODE] = self::OPT_COMMON_SCHEME_MIGRATION_MODE_ON;
151
  } else {
@@ -194,8 +219,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
194
 
195
  set_transient( self::OPT_COMMON_ERROR_MESSAGE, $wp_error->get_error_messages(), 10 );
196
 
197
- //wp_safe_redirect( menu_page_url( 'scc-setting', false ) );
198
-
199
  }
200
 
201
  if( isset( $_POST["reset_data"] ) && $_POST["reset_data"] === __( 'Reset', self::DOMAIN ) ) {
@@ -204,29 +228,35 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
204
  $this->export_engines[self::REF_COMMON_EXPORT]->reset_export();
205
 
206
  //wp_safe_redirect( menu_page_url( 'scc-setting', false ) );
207
-
208
  }
209
 
210
  if( isset( $_POST["export_data"] ) && $_POST["export_data"] === __( 'Export', self::DOMAIN ) ) {
211
  Common_Util::log( '[' . __METHOD__ . '] export' );
212
 
 
 
213
  $this->export_engines[self::REF_COMMON_EXPORT]->execute_export( NULL );
214
 
 
 
215
  //wp_safe_redirect( menu_page_url('scc-setting', false ) );
216
  }
217
 
218
  if( isset( $_POST["update_share_comparison_base"] ) && $_POST["update_share_comparison_base"] === __( 'Update Basis of Comparison', self::DOMAIN ) ) {
219
  Common_Util::log( '[' . __METHOD__ . '] base' );
220
 
 
 
221
  $this->analytical_engines[self::REF_SHARE_ANALYSIS]->execute_base( NULL );
 
 
 
222
  //wp_safe_redirect( menu_page_url( 'scc-setting', false ) );
223
-
224
  }
225
 
226
  if( isset( $_POST["clear_share_base_cache"] ) && $_POST["clear_share_base_cache"] === __( 'Clear Cache', self::DOMAIN ) ) {
227
  Common_Util::log( '[' . __METHOD__ . '] clear cache' );
228
-
229
-
230
  set_time_limit( $this->extended_max_execution_time );
231
 
232
  $this->cache_engines[self::REF_SHARE_BASE]->clear_cache();
@@ -241,8 +271,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
241
 
242
  if( isset( $_POST["clear_follow_base_cache"] ) && $_POST["clear_follow_base_cache"] === __( 'Clear Cache', self::DOMAIN ) ) {
243
  Common_Util::log( '[' . __METHOD__ . '] clear cache' );
244
-
245
-
246
  set_time_limit( $this->extended_max_execution_time );
247
 
248
  $this->cache_engines[self::REF_FOLLOW_BASE]->clear_cache();
@@ -258,7 +287,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
258
 
259
  ?>
260
  <div class="wrap">
261
- <h2><a href="admin.php?page=scc-setting"><?php _e( 'SNS Count Cache', self::DOMAIN ) ?></a></h2>
262
  <?php
263
  if ( $messages = get_transient( self::OPT_COMMON_ERROR_MESSAGE ) ) {
264
  ?>
@@ -279,14 +308,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
279
  ?>
280
  <div class="sns-cnt-cache">
281
  <h3 class="nav-tab-wrapper">
282
- <a class="nav-tab" href="admin.php?page=scc-dashboard"><?php _e( 'Dashboard', self::DOMAIN ) ?></a>
283
- <a class="nav-tab" href="admin.php?page=scc-cache-status"><?php _e( 'Cache Status', self::DOMAIN ) ?></a>
284
- <a class="nav-tab" href="admin.php?page=scc-share-count"><?php _e( 'Share Count', self::DOMAIN ) ?></a>
285
  <?php if ( $this->share_variation_analysis_mode !== self::OPT_SHARE_VARIATION_ANALYSIS_NONE ) { ?>
286
- <a class="nav-tab" href="admin.php?page=scc-hot-content"><?php _e( 'Hot Content', self::DOMAIN ) ?></a>
287
  <?php } ?>
288
- <a class="nav-tab nav-tab-active" href="admin.php?page=scc-setting"><?php _e( 'Setting', self::DOMAIN ) ?></a>
289
- <a class="nav-tab" href="admin.php?page=scc-help"><?php _e( 'Help', self::DOMAIN ) ?></a>
290
  </h3>
291
  <p id="options-menu">
292
  <a href="#current-parameter"><?php _e( 'Current Setting', self::DOMAIN ); ?></a> | <a href="#share-base-cache"><?php _e( 'Share Base Cache', self::DOMAIN ); ?></a> | <a href="#share-rush-cache"><?php _e( 'Share Rush Cache', self::DOMAIN ); ?></a> | <a href="#share-variation-analysis"><?php _e( 'Share Variation Analysis', self::DOMAIN ); ?></a> | <a href="#follow-base-cache"><?php _e( 'Follow Base Cache', self::DOMAIN ); ?></a> | <a href="#common-dynamic-cache"><?php _e( 'Dynamic Cache', self::DOMAIN ); ?></a> | <a href="#common-data-crawler"><?php _e( 'Data Crawler', self::DOMAIN ); ?></a> | <a href="#common-data-export"><?php _e( 'Data Export', self::DOMAIN ); ?></a> | <a href="#common-exported-file"><?php _e( 'Exported File', self::DOMAIN ); ?></a>
@@ -294,19 +323,20 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
294
  <div class="metabox-holder">
295
  <div id="current-parameter" class="postbox">
296
  <div class="handlediv" title="Click to toggle"><br></div>
297
- <h3 class="hndle"><span><?php _e( 'Current Setting', self::DOMAIN ) ?></span></h3>
298
  <div class="inside">
299
  <table class="view-table">
300
  <thead>
301
  <tr>
302
- <th><?php _e( 'Function', self::DOMAIN ) ?></th>
303
- <th><?php _e( 'Parameter', self::DOMAIN ) ?></th>
304
- <th><?php _e( 'Value', self::DOMAIN ) ?></th>
305
  </tr>
306
  </thead>
307
  <tbody>
308
  <tr>
309
- <td><?php _e( 'Share Base Cache', self::DOMAIN) ?></td><td><?php _e( 'Target SNS', self::DOMAIN ) ?></td>
 
310
  <td>
311
  <?php
312
  $target_sns = array();
@@ -317,7 +347,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
317
  $target_sns[] = 'Google+';
318
  }
319
  if ( isset( $this->share_base_cache_target[self::REF_SHARE_HATEBU] ) && $this->share_base_cache_target[self::REF_SHARE_HATEBU] ) {
320
- $target_sns[] = 'Hatena Bookmark';
321
  }
322
  /*
323
  if ( isset( $this->share_base_cache_target[self::REF_SHARE_LINKEDIN] ) && $this->share_base_cache_target[self::REF_SHARE_LINKEDIN] ) {
@@ -338,8 +368,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
338
  </td>
339
  </tr>
340
  <tr>
341
- <td><?php _e( 'Share Base Cache', self::DOMAIN ) ?></td>
342
- <td><?php _e( 'Additional custom post types', self::DOMAIN ) ?></td>
343
  <td><?php
344
  if ( ! empty( $this->share_base_custom_post_types ) && $this->share_base_custom_post_types ) {
345
  echo esc_html( implode( ',', $this->share_base_custom_post_types ) );
@@ -350,18 +380,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
350
  </td>
351
  </tr>
352
  <tr>
353
- <td><?php _e( 'Share Base Cache', self::DOMAIN ) ?></td>
354
- <td><?php _e( 'Interval cheking and caching share count', self::DOMAIN ) ?></td>
355
- <td><?php echo esc_html( $this->share_base_check_interval ) . ' seconds'; ?></td>
356
  </tr>
357
  <tr>
358
- <td><?php _e( 'Share Base Cache', self::DOMAIN ) ?></td>
359
- <td><?php _e( 'Number of posts to check at a time', self::DOMAIN ) ?></td>
360
- <td><?php echo esc_html( $this->share_base_posts_per_check ) . ' posts'; ?></td>
361
  </tr>
362
  <tr>
363
- <td><?php _e( 'Share Base Cache', self::DOMAIN ) ?></td>
364
- <td><?php _e( 'Scheme migration mode from http to https', self::DOMAIN ) ?></td>
365
  <td>
366
  <?php
367
  if ( $this->scheme_migration_mode ) {
@@ -374,8 +404,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
374
  </tr>
375
  <?php if ( $this->scheme_migration_mode ) { ?>
376
  <tr>
377
- <td><?php _e( 'Share Base Cache', self::DOMAIN ) ?></td>
378
- <td><?php _e( 'Scheme migration date from http to https', self::DOMAIN ) ?></td>
379
  <td>
380
  <?php
381
  if ( isset( $this->scheme_migration_date ) ) {
@@ -388,31 +418,31 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
388
  </tr>
389
  <?php } ?>
390
  <tr>
391
- <td><?php _e( 'Share Rush Cache', self::DOMAIN ) ?></td>
392
- <td><?php _e( 'Term considering posted content as new content', self::DOMAIN ) ?></td>
393
  <td>
394
  <?php
395
  if ( $this->share_rush_new_content_term == 1 ) {
396
- echo esc_html( $this->share_rush_new_content_term ) . ' day';
397
  } elseif ( $this->share_rush_new_content_term > 1 ) {
398
- echo esc_html( $this->share_rush_new_content_term ) . ' days';
399
  }
400
  ?>
401
  </td>
402
  </tr>
403
  <tr>
404
- <td><?php _e( 'Share Rush Cache', self::DOMAIN ) ?></td>
405
- <td><?php _e( 'Interval cheking and caching share count(sec)', self::DOMAIN ) ?></td>
406
  <td>
407
  <?php
408
- echo esc_html( $this->share_rush_check_interval ) . ' seconds'
409
  ?>
410
  </td>
411
  </tr>
412
 
413
  <tr>
414
- <td><?php _e( 'Share Variation Analysis', self::DOMAIN ) ?></td>
415
- <td><?php _e( 'Method to update basis of comparison', self::DOMAIN ) ?></td><td>
416
  <?php
417
  switch ( $this->share_variation_analysis_mode ) {
418
  case self::OPT_SHARE_VARIATION_ANALYSIS_NONE:
@@ -432,15 +462,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
432
  if ( $this->share_variation_analysis_mode === self::OPT_SHARE_VARIATION_ANALYSIS_SCHEDULER ) {
433
  ?>
434
  <tr>
435
- <td><?php _e( 'Share Variation Analysis', self::DOMAIN ) ?></td>
436
- <td><?php _e( 'Schedule', self::DOMAIN ) ?></td>
437
  <td><?php echo esc_html( $this->share_variation_analysis_schedule ); ?></td>
438
  </tr>
439
  <?php
440
  }
441
  ?>
442
  <tr>
443
- <td><?php _e( 'Follow Base Cache', self::DOMAIN) ?></td><td><?php _e( 'Target SNS', self::DOMAIN ) ?></td>
 
444
  <td>
445
  <?php
446
  $target_sns = array();
@@ -452,12 +483,47 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
452
  </td>
453
  </tr>
454
  <tr>
455
- <td><?php _e( 'Follow Base Cache', self::DOMAIN ) ?></td>
456
- <td><?php _e( 'Interval cheking and caching follower count', self::DOMAIN ) ?></td>
457
- <td><?php echo esc_html( $this->follow_base_check_interval ) . ' seconds'; ?></td>
458
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
459
  <tr>
460
- <td><?php _e( 'Dynamic Cache', self::DOMAIN) ?></td><td><?php _e( 'Dynamic caching based on user access', self::DOMAIN ) ?></td><td>
 
461
  <?php
462
  switch ( $this->dynamic_cache_mode ) {
463
  case self::OPT_COMMON_ACCESS_BASED_CACHE_NONE:
@@ -477,7 +543,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
477
  </td>
478
  </tr>
479
  <tr>
480
- <td><?php _e( 'Data Crawler', self::DOMAIN) ?></td><td><?php _e( 'Crawl method', self::DOMAIN ) ?></td>
 
481
  <td>
482
  <?php
483
  switch ( $this->crawler_method ) {
@@ -492,7 +559,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
492
  </td>
493
  </tr>
494
  <tr>
495
- <td><?php _e( 'Data Crawler', self::DOMAIN ) ?></td><td><?php _e( 'SSL verification', self::DOMAIN ) ?></td>
 
496
  <td>
497
  <?php
498
  if ( $this->crawler_ssl_verification ) {
@@ -504,7 +572,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
504
  </td>
505
  </tr>
506
  <tr>
507
- <td><?php _e( 'Data Export', self::DOMAIN ) ?></td><td><?php _e( 'Method of data export', self::DOMAIN ) ?></td><td>
 
508
  <?php
509
  switch ( $this->data_export_mode ) {
510
  case self::OPT_COMMON_DATA_EXPORT_MANUAL:
@@ -521,9 +590,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
521
  if ( $this->data_export_mode === self::OPT_COMMON_DATA_EXPORT_SCHEDULER ) {
522
  ?>
523
  <tr>
524
- <td><?php _e( 'Data Export', self::DOMAIN ) ?></td>
525
- <td><?php _e( 'Interval exporting share count to a csv file', self::DOMAIN ) ?></td>
526
- <td><?php echo esc_html( $this->data_export_interval / 3600 ) . ' hours'; ?></td>
527
  </tr>
528
  <?php
529
  }
@@ -538,72 +607,72 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
538
  <?php wp_nonce_field( __FILE__, '_wpnonce' ); ?>
539
  <div id="share-base-cache" class="postbox">
540
  <div class="handlediv" title="Click to toggle"><br></div>
541
- <h3 class="hndle"><span><?php _e('Share Base Cache', self::DOMAIN) ?></span></h3>
542
  <div class="inside">
543
  <table class="form-table">
544
  <tr>
545
- <th><label><?php _e( 'Target SNS', self::DOMAIN ) ?></label></th>
546
  <td>
547
  <div class="sns-check">
548
  <input type="checkbox" value="1" name="share_base_cache_target_facebook"<?php if ( $this->share_base_cache_target[self::REF_SHARE_FACEBOOK] ) echo ' checked="checked"'; ?> />
549
- <label><?php _e( 'Facebook', self::DOMAIN ) ?></label>
550
  </div>
551
  <div class="sns-check">
552
  <input type="checkbox" value="1" name="share_base_cache_target_gplus"<?php if ( $this->share_base_cache_target[self::REF_SHARE_GPLUS] ) echo ' checked="checked"'; ?> />
553
- <label><?php _e( 'Google+', self::DOMAIN ) ?></label>
554
  </div>
555
  <div class="sns-check">
556
  <input type="checkbox" value="1" name="share_base_cache_target_hatebu"<?php if ( $this->share_base_cache_target[self::REF_SHARE_HATEBU] ) echo ' checked="checked"'; ?> />
557
- <label><?php _e( 'Hatena Bookmark', self::DOMAIN ) ?></label>
558
  </div>
559
  <div class="sns-check">
560
  <input type="checkbox" value="1" name="share_base_cache_target_pocket"<?php if ( $this->share_base_cache_target[self::REF_SHARE_POCKET] ) echo ' checked="checked"'; ?> />
561
- <label><?php _e( 'Pocket', self::DOMAIN ) ?></label>
562
  </div>
563
  <div class="sns-check">
564
  <input type="checkbox" value="1" name="share_base_cache_target_twitter"<?php if ( $this->share_base_cache_target[self::REF_SHARE_TWITTER] ) echo ' checked="checked"'; ?> />
565
- <label><?php _e( 'Twitter', self::DOMAIN ) ?></label>
566
  </div>
567
  </td>
568
  </tr>
569
  <tr>
570
- <th><label><?php _e( 'Additional custom post types', self::DOMAIN ) ?></label></th>
571
  <td>
572
  <input type="text" class="text" name="share_base_custom_post_types" size="60" value="<?php echo esc_html( implode( ',', $this->share_base_custom_post_types ) ); ?>" />
573
  <br>
574
- <label><?php _e( 'e.g. aaa, bbb, ccc (comma-delimited)', self::DOMAIN ) ?></label>
575
  </td>
576
  </tr>
577
  <tr>
578
- <th><label><?php _e( 'Interval cheking and caching share count (sec)', self::DOMAIN ) ?></label></th>
579
  <td>
580
  <input type="text" class="text" name="share_base_check_interval" size="20" value="<?php echo esc_html( $this->share_base_check_interval ); ?>" />
581
- <label><?php _e( 'Default: 600', self::DOMAIN ) ?></label>
582
  </td>
583
  </tr>
584
  <tr>
585
- <th><label><?php _e( 'Number of posts to check at a time (posts)', self::DOMAIN ) ?></label></th>
586
  <td>
587
  <input type="text" class="text" name="share_base_posts_per_check" size="20" value="<?php echo esc_html( $this->share_base_posts_per_check ); ?>" />
588
- <label><?php _e( 'Default: 20', self::DOMAIN ) ?></label>
589
  </td>
590
  </tr>
591
  <tr>
592
- <th><label><?php _e( 'Scheme migration mode from http to https', self::DOMAIN ) ?></label></th>
593
  <td>
594
  <select name="scheme_migration_mode">
595
- <option value="0"<?php if ( $this->scheme_migration_mode === self::OPT_COMMON_SCHEME_MIGRATION_MODE_OFF ) echo ' selected="selected"'; ?>><?php _e( 'Off', self::DOMAIN ) ?></option>
596
- <option value="1"<?php if ( $this->scheme_migration_mode === self::OPT_COMMON_SCHEME_MIGRATION_MODE_ON ) echo ' selected="selected"'; ?>><?php _e( 'On', self::DOMAIN ) ?></option>
597
  </select>
598
- <label><?php _e('Default: Off', self::DOMAIN) ?></label>
599
  </td>
600
  </tr>
601
  <?php if ( $this->scheme_migration_mode ) { ?>
602
  <tr>
603
- <th><label><?php _e( 'Scheme migration date from http to https', self::DOMAIN ) ?></label></th>
604
  <td>
605
  <input id="scheme-migration-date" type="text" class="text" name="scheme_migration_date" size="20" value="<?php echo esc_html( $this->scheme_migration_date ); ?>" />
606
- <label><?php _e( 'Default: N/A', self::DOMAIN ) ?></label>
607
  <script>
608
  jQuery(document).ready(function() {
609
  jQuery('#scheme-migration-date').datepicker({
@@ -616,68 +685,68 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
616
  <?php } ?>
617
  </table>
618
  <div class="submit-button">
619
- <input type="submit" class="button button-primary" name="update_all_options" value="<?php _e( 'Update All Options', self::DOMAIN ) ?>" />
620
- <input type="submit" class="button" name="clear_share_base_cache" value="<?php _e( 'Clear Cache', self::DOMAIN ) ?>">
621
  </div>
622
  </div>
623
  </div>
624
  <div id="share-rush-cache" class="postbox">
625
  <div class="handlediv" title="Click to toggle"><br></div>
626
- <h3 class="hndle"><span><?php _e('Share Rush Cache', self::DOMAIN) ?></span></h3>
627
  <div class="inside">
628
  <table class="form-table">
629
  <tr>
630
- <th><label><?php _e( 'Term considering posted content as new content', self::DOMAIN ) ?></label></th>
631
  <td>
632
  <select name="share_rush_new_content_term">
633
- <option value="1"<?php if ( $this->share_rush_new_content_term === 1 ) echo ' selected="selected"'; ?>>1 day</option>
634
- <option value="2"<?php if ( $this->share_rush_new_content_term === 2 ) echo ' selected="selected"'; ?>>2 days</option>
635
- <option value="3"<?php if ( $this->share_rush_new_content_term === 3 ) echo ' selected="selected"'; ?>>3 days</option>
636
- <option value="4"<?php if ( $this->share_rush_new_content_term === 4 ) echo ' selected="selected"'; ?>>4 days</option>
637
- <option value="5"<?php if ( $this->share_rush_new_content_term === 5 ) echo ' selected="selected"'; ?>>5 days</option>
638
- <option value="6"<?php if ( $this->share_rush_new_content_term === 6 ) echo ' selected="selected"'; ?>>6 days</option>
639
- <option value="7"<?php if ( $this->share_rush_new_content_term === 7 ) echo ' selected="selected"'; ?>>7 days</option>
640
- <option value="8"<?php if ( $this->share_rush_new_content_term === 8 ) echo ' selected="selected"'; ?>>8 days</option>
641
- <option value="9"<?php if ( $this->share_rush_new_content_term === 9 ) echo ' selected="selected"'; ?>>9 days</option>
642
- <option value="10"<?php if ( $this->share_rush_new_content_term === 10 ) echo ' selected="selected"'; ?>>10 days</option>
643
- <option value="11"<?php if ( $this->share_rush_new_content_term === 11 ) echo ' selected="selected"'; ?>>11 days</option>
644
- <option value="12"<?php if ( $this->share_rush_new_content_term === 12 ) echo ' selected="selected"'; ?>>12 days</option>
645
- <option value="13"<?php if ( $this->share_rush_new_content_term === 13 ) echo ' selected="selected"'; ?>>13 days</option>
646
- <option value="14"<?php if ( $this->share_rush_new_content_term === 14 ) echo ' selected="selected"'; ?>>14 days</option>
647
  </select>
648
- <label><?php _e( 'Default: 3 days', self::DOMAIN ) ?></label>
649
  </td>
650
  </tr>
651
 
652
  <tr>
653
- <th><label><?php _e( 'Interval cheking and caching share count(sec)', self::DOMAIN ) ?></label></th>
654
  <td>
655
  <?php
656
- echo esc_html( $this->share_rush_check_interval ) . ' seconds'
657
  ?>
658
  </td>
659
  </tr>
660
 
661
  </table>
662
  <div class="submit-button">
663
- <input type="submit" class="button button-primary" name="update_all_options" value="<?php _e( 'Update All Options', self::DOMAIN ) ?>" />
664
  </div>
665
  </div>
666
  </div>
667
  <div id="share-variation-analysis" class="postbox">
668
  <div class="handlediv" title="Click to toggle"><br></div>
669
- <h3 class="hndle"><span><?php _e('Share Variation Analysis', self::DOMAIN) ?></span></h3>
670
  <div class="inside">
671
  <table class="form-table">
672
  <tr>
673
- <th><label><?php _e( 'Method to update basis of comparison', self::DOMAIN ) ?></label></th>
674
  <td>
675
  <select name="share_variation_analysis_mode">
676
- <option value="1"<?php if ( $this->share_variation_analysis_mode === self::OPT_SHARE_VARIATION_ANALYSIS_NONE ) echo ' selected="selected"'; ?>><?php _e( 'Disabled (None)', self::DOMAIN ) ?></option>
677
- <option value="2"<?php if ( $this->share_variation_analysis_mode === self::OPT_SHARE_VARIATION_ANALYSIS_MANUAL ) echo ' selected="selected"'; ?>><?php _e( 'Enabled (Manual)', self::DOMAIN ) ?></option>
678
- <option value="3"<?php if ( $this->share_variation_analysis_mode === self::OPT_SHARE_VARIATION_ANALYSIS_SCHEDULER ) echo ' selected="selected"'; ?>><?php _e( 'Enabled (Scheduler)', self::DOMAIN ) ?></option>
679
  </select>
680
- <label><?php _e( 'Default: None', self::DOMAIN ) ?></label>
681
  </td>
682
  </tr>
683
 
@@ -737,7 +806,104 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
737
  <td>
738
  <select name="a_moncronmday">
739
  <?php for ( $i = 1; $i <= 31; $i ++ ) {
740
- echo '<option ' . selected( in_array( "$i", $mday, TRUE ), TRUE, FALSE ) . ' value="' . $i . '" />' . __( 'on', self::DOMAIN ) . ' ' . $i . '.</option>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
741
  } ?>
742
  </select>
743
  </td>
@@ -818,69 +984,99 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
818
  ?>
819
  </table>
820
  <div class="submit-button">
821
- <input type="submit" class="button button-primary" name="update_all_options" value="<?php _e( 'Update All Options', self::DOMAIN ) ?>" />
822
- <input type="submit" class="button" name="update_share_comparison_base" value="<?php _e( 'Update Basis of Comparison', self::DOMAIN ) ?>" />
823
  </div>
824
  </div>
825
  </div>
826
  <div id="follow-base-cache" class="postbox">
827
  <div class="handlediv" title="Click to toggle"><br></div>
828
- <h3 class="hndle"><span><?php _e('Follow Base Cache', self::DOMAIN) ?></span></h3>
829
  <div class="inside">
830
  <table class="form-table">
831
  <tr>
832
- <th><label><?php _e( 'Target SNS', self::DOMAIN ) ?></label></th>
833
  <td>
834
  <div class="sns-check">
835
  <input type="checkbox" value="1" name="follow_base_cache_target_feedly"<?php if ( $this->follow_base_cache_target[self::REF_FOLLOW_FEEDLY] ) echo ' checked="checked"'; ?> />
836
- <label><?php _e( 'Feedly', self::DOMAIN ) ?></label>
837
  </div>
838
  </td>
839
  </tr>
840
  <tr>
841
- <th><label><?php _e( 'Interval cheking and caching follower count (sec)', self::DOMAIN ) ?></label></th>
842
  <td>
843
  <input type="text" class="text" name="follow_base_check_interval" size="20" value="<?php echo esc_html( $this->follow_base_check_interval); ?>" />
844
- <label><?php _e( 'Default: 86400 Minimum: 3600', self::DOMAIN ) ?></label>
845
  </td>
846
  </tr>
847
  </table>
848
  <div class="submit-button">
849
- <input type="submit" class="button button-primary" name="update_all_options" value="<?php _e( 'Update All Options', self::DOMAIN ) ?>" />
850
- <input type="submit" class="button" name="clear_follow_base_cache" value="<?php _e( 'Clear Cache', self::DOMAIN ) ?>">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
851
  </div>
852
  </div>
853
- </div>
 
854
  <div id="common-dynamic-cache" class="postbox">
855
  <div class="handlediv" title="Click to toggle"><br></div>
856
- <h3 class="hndle"><span><?php _e( 'Dynamic Cache', self::DOMAIN ) ?></span></h3>
857
  <div class="inside">
858
  <table class="form-table">
859
  <tr>
860
- <th><label><?php _e( 'Dynamic caching based on user access', self::DOMAIN ) ?></label></th>
861
  <td>
862
  <select name="dynamic_cache_mode">
863
- <option value="1"<?php if ( $this->dynamic_cache_mode === self::OPT_COMMON_ACCESS_BASED_CACHE_NONE ) echo ' selected="selected"'; ?>><?php _e( 'Disabled (None)', self::DOMAIN ) ?></option>
864
- <option value="2"<?php if ( $this->dynamic_cache_mode === self::OPT_COMMON_ACCESS_BASED_SYNC_CACHE ) echo ' selected="selected"'; ?>><?php _e( 'Enabled (Synchronous Cache)', self::DOMAIN ) ?></option>
865
- <option value="3"<?php if ( $this->dynamic_cache_mode === self::OPT_COMMON_ACCESS_BASED_ASYNC_CACHE ) echo ' selected="selected"'; ?>><?php _e( 'Enabled (Asynchronous Cache)', self::DOMAIN ) ?></option>
866
- <option value="4"<?php if ( $this->dynamic_cache_mode === self::OPT_COMMON_ACCESS_BASED_2ND_CACHE ) echo ' selected="selected"'; ?>><?php _e( 'Enabled (Asynchronous 2nd Cache)', self::DOMAIN ) ?></option>
867
  </select>
868
- <label><?php _e( 'Default: Enabled (Asynchronous 2nd Cache)', self::DOMAIN) ?></label>
869
  </td>
870
  </tr>
871
  </table>
872
  <div class="submit-button">
873
- <input type="submit" class="button button-primary" name="update_all_options" value="<?php _e( 'Update All Options', self::DOMAIN ) ?>" />
874
  </div>
875
  </div>
876
  </div>
877
  <div id="common-data-crawler" class="postbox">
878
  <div class="handlediv" title="Click to toggle"><br></div>
879
- <h3 class="hndle"><span><?php _e( 'Data Crawler', self::DOMAIN) ?></span></h3>
880
  <div class="inside">
881
  <table class="form-table">
882
  <tr>
883
- <th><label><?php _e( 'Crawl method', self::DOMAIN ) ?></label></th>
884
  <td>
885
  <?php
886
  switch ( $this->crawler_method ) {
@@ -895,34 +1091,34 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
895
  </td>
896
  </tr>
897
  <tr>
898
- <th><label><?php _e( 'SSL verification', self::DOMAIN ) ?></label></th>
899
  <td>
900
  <select name="crawler_ssl_verification">
901
- <option value="0"<?php if ( $this->crawler_ssl_verification === self::OPT_COMMON_CRAWLER_SSL_VERIFY_OFF ) echo ' selected="selected"'; ?>><?php _e( 'Off', self::DOMAIN ) ?></option>
902
- <option value="1"<?php if ( $this->crawler_ssl_verification === self::OPT_COMMON_CRAWLER_SSL_VERIFY_ON ) echo ' selected="selected"'; ?>><?php _e( 'On', self::DOMAIN ) ?></option>
903
  </select>
904
- <label><?php _e( 'Default: On', self::DOMAIN) ?></label>
905
  </td>
906
  </tr>
907
  </table>
908
  <div class="submit-button">
909
- <input type="submit" class="button button-primary" name="update_all_options" value="<?php _e( 'Update All Options', self::DOMAIN ) ?>" />
910
  </div>
911
  </div>
912
  </div>
913
  <div id="common-data-export" class="postbox">
914
  <div class="handlediv" title="Click to toggle"><br></div>
915
- <h3 class="hndle"><span><?php _e( 'Data Export', self::DOMAIN) ?></span></h3>
916
  <div class="inside">
917
  <table class="form-table">
918
  <tr>
919
- <th><label><?php _e( 'Method of data export', self::DOMAIN ) ?></label></th>
920
  <td>
921
  <select name="data_export_mode">
922
- <option value="1"<?php if ( $this->data_export_mode === self::OPT_COMMON_DATA_EXPORT_MANUAL ) echo ' selected="selected"'; ?>><?php _e( 'Manual', self::DOMAIN ) ?></option>
923
- <option value="2"<?php if ( $this->data_export_mode === self::OPT_COMMON_DATA_EXPORT_SCHEDULER ) echo ' selected="selected"'; ?> disabled="disabled"><?php _e( 'Scheduler', self::DOMAIN ) ?></option>
924
  </select>
925
- <label><?php _e( 'Default: Manual', self::DOMAIN) ?></label>
926
  </td>
927
  </tr>
928
  <?php
@@ -981,7 +1177,104 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
981
  <td>
982
  <select name="e_moncronmday">
983
  <?php for ( $i = 1; $i <= 31; $i ++ ) {
984
- echo '<option ' . selected( in_array( "$i", $mday, TRUE ), TRUE, FALSE ) . ' value="' . $i . '" />' . __( 'on', self::DOMAIN ) . ' ' . $i . '.</option>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
985
  } ?>
986
  </select>
987
  </td>
@@ -1078,7 +1371,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1078
  ?>
1079
  </table>
1080
  <div class="submit-button">
1081
- <input type="submit" class="button button-primary" name="update_all_options" value="<?php _e( 'Update All Options', self::DOMAIN ) ?>" />
1082
  </div>
1083
  </div>
1084
  </div>
@@ -1087,12 +1380,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1087
  <div class="metabox-holder">
1088
  <div id="common-exported-file" class="postbox">
1089
  <div class="handlediv" title="Click to toggle"><br></div>
1090
- <h3 class="hndle"><span><?php _e('Exported File', self::DOMAIN) ?></span></h3>
1091
  <div class="inside">
1092
  <table class="form-table">
1093
  <tbody>
1094
  <tr>
1095
- <th><?php _e( 'Disk usage of exported file', self::DOMAIN ) ?></th>
1096
  <td>
1097
  <?php
1098
  $abs_path = WP_PLUGIN_DIR . '/sns-count-cache/data/sns-count-cache-data.csv';
@@ -1101,7 +1394,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1101
  if ( isset( $file_size ) ) {
1102
  echo $file_size;
1103
  } else {
1104
- _e( 'No exported file', self::DOMAIN);
1105
  }
1106
  ?>
1107
  </td>
@@ -1113,11 +1406,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1113
  <table class="form-table">
1114
  <tbody>
1115
  <tr>
1116
- <th><?php _e( 'Manual export', self::DOMAIN ) ?></th>
1117
  <td>
1118
- <input type="submit" class="button" name="export_data" value="<?php _e( 'Export', self::DOMAIN ) ?>" />
1119
  <br>
1120
- <span class="description">Export share count to a csv file.</span>
1121
  </td>
1122
  </tr>
1123
  </tbody>
@@ -1131,11 +1424,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1131
  <table class="form-table">
1132
  <tbody>
1133
  <tr>
1134
- <th>Reset of exported file</th>
1135
  <td>
1136
- <input type="submit" class="button" name="reset_data" value="<?php _e( 'Reset', self::DOMAIN ) ?>" />
1137
  <br>
1138
- <span class="description">Clear exported csv file.</span>
1139
  </td>
1140
  </tr>
1141
  </tbody>
@@ -1146,11 +1439,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1146
  <table class="form-table">
1147
  <tbody>
1148
  <tr>
1149
- <th>Download of exported file</th>
1150
  <td>
1151
- <input type="submit" class="button" name="download_data" value="<?php _e( 'Download', self::DOMAIN ) ?>" />
1152
  <br>
1153
- <span class="description">Download the exported csv file.</span>
1154
  </td>
1155
  </tr>
1156
  </tbody>
146
  $settings[self::DB_FOLLOW_CACHE_TARGET] = $follow_base_cache_target;
147
  }
148
 
149
+ if ( isset( $_POST["follow_feed_type"] ) && $_POST["follow_feed_type"] ) {
150
+ switch ( $_POST["follow_feed_type"] ) {
151
+ case 'default':
152
+ $settings[self::DB_FOLLOW_FEED_TYPE] = self::OPT_FEED_TYPE_DEFAULT;
153
+ break;
154
+ case 'rss2':
155
+ $settings[self::DB_FOLLOW_FEED_TYPE] = self::OPT_FEED_TYPE_RSS2;
156
+ break;
157
+ case 'rss':
158
+ $settings[self::DB_FOLLOW_FEED_TYPE] = self::OPT_FEED_TYPE_RSS;
159
+ break;
160
+ case 'rdf':
161
+ $settings[self::DB_FOLLOW_FEED_TYPE] = self::OPT_FEED_TYPE_RDF;
162
+ break;
163
+ case 'atom':
164
+ $settings[self::DB_FOLLOW_FEED_TYPE] = self::OPT_FEED_TYPE_ATOM;
165
+ break;
166
+ default:
167
+ $settings[self::DB_FOLLOW_FEED_TYPE] = self::OPT_FEED_TYPE_DEFAULT;
168
+ }
169
+
170
+ } else {
171
+ $settings[self::DB_FOLLOW_FEED_TYPE] = self::OPT_FEED_TYPE_DEFAULT;
172
+ }
173
+
174
  if ( isset( $_POST["scheme_migration_mode"] ) && $_POST["scheme_migration_mode"] ) {
175
  $settings[self::DB_COMMON_SCHEME_MIGRATION_MODE] = self::OPT_COMMON_SCHEME_MIGRATION_MODE_ON;
176
  } else {
219
 
220
  set_transient( self::OPT_COMMON_ERROR_MESSAGE, $wp_error->get_error_messages(), 10 );
221
 
222
+ //wp_safe_redirect( menu_page_url( 'scc-setting', false ) );
 
223
  }
224
 
225
  if( isset( $_POST["reset_data"] ) && $_POST["reset_data"] === __( 'Reset', self::DOMAIN ) ) {
228
  $this->export_engines[self::REF_COMMON_EXPORT]->reset_export();
229
 
230
  //wp_safe_redirect( menu_page_url( 'scc-setting', false ) );
 
231
  }
232
 
233
  if( isset( $_POST["export_data"] ) && $_POST["export_data"] === __( 'Export', self::DOMAIN ) ) {
234
  Common_Util::log( '[' . __METHOD__ . '] export' );
235
 
236
+ set_time_limit( $this->extended_max_execution_time );
237
+
238
  $this->export_engines[self::REF_COMMON_EXPORT]->execute_export( NULL );
239
 
240
+ set_time_limit( $this->original_max_execution_time );
241
+
242
  //wp_safe_redirect( menu_page_url('scc-setting', false ) );
243
  }
244
 
245
  if( isset( $_POST["update_share_comparison_base"] ) && $_POST["update_share_comparison_base"] === __( 'Update Basis of Comparison', self::DOMAIN ) ) {
246
  Common_Util::log( '[' . __METHOD__ . '] base' );
247
 
248
+ set_time_limit( $this->extended_max_execution_time );
249
+
250
  $this->analytical_engines[self::REF_SHARE_ANALYSIS]->execute_base( NULL );
251
+
252
+ set_time_limit( $this->original_max_execution_time );
253
+
254
  //wp_safe_redirect( menu_page_url( 'scc-setting', false ) );
 
255
  }
256
 
257
  if( isset( $_POST["clear_share_base_cache"] ) && $_POST["clear_share_base_cache"] === __( 'Clear Cache', self::DOMAIN ) ) {
258
  Common_Util::log( '[' . __METHOD__ . '] clear cache' );
259
+
 
260
  set_time_limit( $this->extended_max_execution_time );
261
 
262
  $this->cache_engines[self::REF_SHARE_BASE]->clear_cache();
271
 
272
  if( isset( $_POST["clear_follow_base_cache"] ) && $_POST["clear_follow_base_cache"] === __( 'Clear Cache', self::DOMAIN ) ) {
273
  Common_Util::log( '[' . __METHOD__ . '] clear cache' );
274
+
 
275
  set_time_limit( $this->extended_max_execution_time );
276
 
277
  $this->cache_engines[self::REF_FOLLOW_BASE]->clear_cache();
287
 
288
  ?>
289
  <div class="wrap">
290
+ <h2><a href="admin.php?page=scc-setting"><?php _e( 'SNS Count Cache', self::DOMAIN ); ?></a></h2>
291
  <?php
292
  if ( $messages = get_transient( self::OPT_COMMON_ERROR_MESSAGE ) ) {
293
  ?>
308
  ?>
309
  <div class="sns-cnt-cache">
310
  <h3 class="nav-tab-wrapper">
311
+ <a class="nav-tab" href="admin.php?page=scc-dashboard"><?php _e( 'Dashboard', self::DOMAIN ); ?></a>
312
+ <a class="nav-tab" href="admin.php?page=scc-cache-status"><?php _e( 'Cache Status', self::DOMAIN ); ?></a>
313
+ <a class="nav-tab" href="admin.php?page=scc-share-count"><?php _e( 'Share Count', self::DOMAIN ); ?></a>
314
  <?php if ( $this->share_variation_analysis_mode !== self::OPT_SHARE_VARIATION_ANALYSIS_NONE ) { ?>
315
+ <a class="nav-tab" href="admin.php?page=scc-hot-content"><?php _e( 'Hot Content', self::DOMAIN ); ?></a>
316
  <?php } ?>
317
+ <a class="nav-tab nav-tab-active" href="admin.php?page=scc-setting"><?php _e( 'Setting', self::DOMAIN ); ?></a>
318
+ <a class="nav-tab" href="admin.php?page=scc-help"><?php _e( 'Help', self::DOMAIN ); ?></a>
319
  </h3>
320
  <p id="options-menu">
321
  <a href="#current-parameter"><?php _e( 'Current Setting', self::DOMAIN ); ?></a> | <a href="#share-base-cache"><?php _e( 'Share Base Cache', self::DOMAIN ); ?></a> | <a href="#share-rush-cache"><?php _e( 'Share Rush Cache', self::DOMAIN ); ?></a> | <a href="#share-variation-analysis"><?php _e( 'Share Variation Analysis', self::DOMAIN ); ?></a> | <a href="#follow-base-cache"><?php _e( 'Follow Base Cache', self::DOMAIN ); ?></a> | <a href="#common-dynamic-cache"><?php _e( 'Dynamic Cache', self::DOMAIN ); ?></a> | <a href="#common-data-crawler"><?php _e( 'Data Crawler', self::DOMAIN ); ?></a> | <a href="#common-data-export"><?php _e( 'Data Export', self::DOMAIN ); ?></a> | <a href="#common-exported-file"><?php _e( 'Exported File', self::DOMAIN ); ?></a>
323
  <div class="metabox-holder">
324
  <div id="current-parameter" class="postbox">
325
  <div class="handlediv" title="Click to toggle"><br></div>
326
+ <h3 class="hndle"><span><?php _e( 'Current Setting', self::DOMAIN ); ?></span></h3>
327
  <div class="inside">
328
  <table class="view-table">
329
  <thead>
330
  <tr>
331
+ <th><?php _e( 'Capability', self::DOMAIN ); ?></th>
332
+ <th><?php _e( 'Parameter', self::DOMAIN ); ?></th>
333
+ <th><?php _e( 'Value', self::DOMAIN ); ?></th>
334
  </tr>
335
  </thead>
336
  <tbody>
337
  <tr>
338
+ <td><?php _e( 'Share Base Cache', self::DOMAIN); ?></td>
339
+ <td><?php _e( 'Target SNS', self::DOMAIN ); ?></td>
340
  <td>
341
  <?php
342
  $target_sns = array();
347
  $target_sns[] = 'Google+';
348
  }
349
  if ( isset( $this->share_base_cache_target[self::REF_SHARE_HATEBU] ) && $this->share_base_cache_target[self::REF_SHARE_HATEBU] ) {
350
+ $target_sns[] = __( 'Hatena Bookmark', self::DOMAIN );
351
  }
352
  /*
353
  if ( isset( $this->share_base_cache_target[self::REF_SHARE_LINKEDIN] ) && $this->share_base_cache_target[self::REF_SHARE_LINKEDIN] ) {
368
  </td>
369
  </tr>
370
  <tr>
371
+ <td><?php _e( 'Share Base Cache', self::DOMAIN ); ?></td>
372
+ <td><?php _e( 'Custom post types', self::DOMAIN ); ?></td>
373
  <td><?php
374
  if ( ! empty( $this->share_base_custom_post_types ) && $this->share_base_custom_post_types ) {
375
  echo esc_html( implode( ',', $this->share_base_custom_post_types ) );
380
  </td>
381
  </tr>
382
  <tr>
383
+ <td><?php _e( 'Share Base Cache', self::DOMAIN ); ?></td>
384
+ <td><?php _e( 'Interval cheking share count (sec)', self::DOMAIN ); ?></td>
385
+ <td><?php echo esc_html( $this->share_base_check_interval ) . ' ' . __( 'seconds', self::DOMAIN ); ?></td>
386
  </tr>
387
  <tr>
388
+ <td><?php _e( 'Share Base Cache', self::DOMAIN ); ?></td>
389
+ <td><?php _e( 'Number of contents to check at a time', self::DOMAIN ) ?></td>
390
+ <td><?php echo esc_html( $this->share_base_posts_per_check ) . ' ' . __( 'contents', self::DOMAIN ); ?></td>
391
  </tr>
392
  <tr>
393
+ <td><?php _e( 'Share Base Cache', self::DOMAIN ); ?></td>
394
+ <td><?php _e( 'Scheme migration mode from http to https', self::DOMAIN ); ?></td>
395
  <td>
396
  <?php
397
  if ( $this->scheme_migration_mode ) {
404
  </tr>
405
  <?php if ( $this->scheme_migration_mode ) { ?>
406
  <tr>
407
+ <td><?php _e( 'Share Base Cache', self::DOMAIN ); ?></td>
408
+ <td><?php _e( 'Scheme migration date from http to https', self::DOMAIN ); ?></td>
409
  <td>
410
  <?php
411
  if ( isset( $this->scheme_migration_date ) ) {
418
  </tr>
419
  <?php } ?>
420
  <tr>
421
+ <td><?php _e( 'Share Rush Cache', self::DOMAIN ); ?></td>
422
+ <td><?php _e( 'Term considering posted content as new content', self::DOMAIN ); ?></td>
423
  <td>
424
  <?php
425
  if ( $this->share_rush_new_content_term == 1 ) {
426
+ echo esc_html( $this->share_rush_new_content_term ) . ' ' . __( 'day', self::DOMAIN );
427
  } elseif ( $this->share_rush_new_content_term > 1 ) {
428
+ echo esc_html( $this->share_rush_new_content_term ) . ' ' . __( 'days', self::DOMAIN );
429
  }
430
  ?>
431
  </td>
432
  </tr>
433
  <tr>
434
+ <td><?php _e( 'Share Rush Cache', self::DOMAIN ); ?></td>
435
+ <td><?php _e( 'Interval cheking share count (sec)', self::DOMAIN ); ?></td>
436
  <td>
437
  <?php
438
+ echo esc_html( $this->share_rush_check_interval ) . ' ' . __( 'seconds', self::DOMAIN );
439
  ?>
440
  </td>
441
  </tr>
442
 
443
  <tr>
444
+ <td><?php _e( 'Share Variation Analysis', self::DOMAIN ); ?></td>
445
+ <td><?php _e( 'Method to update basis of comparison', self::DOMAIN ); ?></td><td>
446
  <?php
447
  switch ( $this->share_variation_analysis_mode ) {
448
  case self::OPT_SHARE_VARIATION_ANALYSIS_NONE:
462
  if ( $this->share_variation_analysis_mode === self::OPT_SHARE_VARIATION_ANALYSIS_SCHEDULER ) {
463
  ?>
464
  <tr>
465
+ <td><?php _e( 'Share Variation Analysis', self::DOMAIN ); ?></td>
466
+ <td><?php _e( 'Schedule', self::DOMAIN ); ?></td>
467
  <td><?php echo esc_html( $this->share_variation_analysis_schedule ); ?></td>
468
  </tr>
469
  <?php
470
  }
471
  ?>
472
  <tr>
473
+ <td><?php _e( 'Follow Base Cache', self::DOMAIN); ?></td>
474
+ <td><?php _e( 'Target SNS', self::DOMAIN ); ?></td>
475
  <td>
476
  <?php
477
  $target_sns = array();
483
  </td>
484
  </tr>
485
  <tr>
486
+ <td><?php _e( 'Follow Base Cache', self::DOMAIN ); ?></td>
487
+ <td><?php _e( 'Interval cheking follower count (sec)', self::DOMAIN ); ?></td>
488
+ <td><?php echo esc_html( $this->follow_base_check_interval ) . ' ' . __( 'seconds', self::DOMAIN ); ?></td>
489
+ </tr>
490
+ <?php if ( $this->follow_base_cache_target[self::REF_FOLLOW_FEEDLY] ) { ?>
491
+ <tr>
492
+ <td><?php _e( 'Follow Base Cache - Feedly', self::DOMAIN ); ?></td>
493
+ <td><?php _e( 'Target feed type', self::DOMAIN ); ?></td>
494
+ <td>
495
+ <?php
496
+ switch ( $this->follow_feed_type ) {
497
+ case self::OPT_FEED_TYPE_DEFAULT:
498
+ _e( 'Default', self::DOMAIN );
499
+ break;
500
+ case self::OPT_FEED_TYPE_RSS:
501
+ _e( 'RSS', self::DOMAIN );
502
+ break;
503
+ case self::OPT_FEED_TYPE_RSS2:
504
+ _e( 'RSS2', self::DOMAIN );
505
+ break;
506
+ case self::OPT_FEED_TYPE_RDF:
507
+ _e( 'RDF', self::DOMAIN );
508
+ break;
509
+ case self::OPT_FEED_TYPE_ATOM:
510
+ _e( 'ATOM', self::DOMAIN );
511
+ break;
512
+ default:
513
+ _e( 'Default', self::DOMAIN );
514
+ }
515
+ ?>
516
+ </td>
517
+ </tr>
518
+ <tr>
519
+ <td><?php _e( 'Follow Base Cache - Feedly', self::DOMAIN ); ?></td>
520
+ <td><?php _e( 'Target feed', self::DOMAIN ); ?></td>
521
+ <td><?php echo get_feed_link( $this->follow_feed_type ); ?></td>
522
+ </tr>
523
+ <?php } ?>
524
  <tr>
525
+ <td><?php _e( 'Dynamic Cache', self::DOMAIN); ?></td>
526
+ <td><?php _e( 'Dynamic caching based on user access', self::DOMAIN ); ?></td><td>
527
  <?php
528
  switch ( $this->dynamic_cache_mode ) {
529
  case self::OPT_COMMON_ACCESS_BASED_CACHE_NONE:
543
  </td>
544
  </tr>
545
  <tr>
546
+ <td><?php _e( 'Data Crawler', self::DOMAIN ); ?></td>
547
+ <td><?php _e( 'Crawl method', self::DOMAIN ); ?></td>
548
  <td>
549
  <?php
550
  switch ( $this->crawler_method ) {
559
  </td>
560
  </tr>
561
  <tr>
562
+ <td><?php _e( 'Data Crawler', self::DOMAIN ); ?></td>
563
+ <td><?php _e( 'SSL verification', self::DOMAIN ); ?></td>
564
  <td>
565
  <?php
566
  if ( $this->crawler_ssl_verification ) {
572
  </td>
573
  </tr>
574
  <tr>
575
+ <td><?php _e( 'Data Export', self::DOMAIN ); ?></td>
576
+ <td><?php _e( 'Method of data export', self::DOMAIN ); ?></td><td>
577
  <?php
578
  switch ( $this->data_export_mode ) {
579
  case self::OPT_COMMON_DATA_EXPORT_MANUAL:
590
  if ( $this->data_export_mode === self::OPT_COMMON_DATA_EXPORT_SCHEDULER ) {
591
  ?>
592
  <tr>
593
+ <td><?php _e( 'Data Export', self::DOMAIN ); ?></td>
594
+ <td><?php _e( 'Interval exporting share count to a csv file', self::DOMAIN ); ?></td>
595
+ <td><?php echo esc_html( $this->data_export_interval / 3600 ) . ' ' . __( 'hours', self::DOMAIN ); ?></td>
596
  </tr>
597
  <?php
598
  }
607
  <?php wp_nonce_field( __FILE__, '_wpnonce' ); ?>
608
  <div id="share-base-cache" class="postbox">
609
  <div class="handlediv" title="Click to toggle"><br></div>
610
+ <h3 class="hndle"><span><?php _e('Share Base Cache', self::DOMAIN); ?></span></h3>
611
  <div class="inside">
612
  <table class="form-table">
613
  <tr>
614
+ <th><label><?php _e( 'Target SNS', self::DOMAIN ); ?></label></th>
615
  <td>
616
  <div class="sns-check">
617
  <input type="checkbox" value="1" name="share_base_cache_target_facebook"<?php if ( $this->share_base_cache_target[self::REF_SHARE_FACEBOOK] ) echo ' checked="checked"'; ?> />
618
+ <label><?php _e( 'Facebook', self::DOMAIN ); ?></label>
619
  </div>
620
  <div class="sns-check">
621
  <input type="checkbox" value="1" name="share_base_cache_target_gplus"<?php if ( $this->share_base_cache_target[self::REF_SHARE_GPLUS] ) echo ' checked="checked"'; ?> />
622
+ <label><?php _e( 'Google+', self::DOMAIN ); ?></label>
623
  </div>
624
  <div class="sns-check">
625
  <input type="checkbox" value="1" name="share_base_cache_target_hatebu"<?php if ( $this->share_base_cache_target[self::REF_SHARE_HATEBU] ) echo ' checked="checked"'; ?> />
626
+ <label><?php _e( 'Hatena Bookmark', self::DOMAIN ); ?></label>
627
  </div>
628
  <div class="sns-check">
629
  <input type="checkbox" value="1" name="share_base_cache_target_pocket"<?php if ( $this->share_base_cache_target[self::REF_SHARE_POCKET] ) echo ' checked="checked"'; ?> />
630
+ <label><?php _e( 'Pocket', self::DOMAIN ); ?></label>
631
  </div>
632
  <div class="sns-check">
633
  <input type="checkbox" value="1" name="share_base_cache_target_twitter"<?php if ( $this->share_base_cache_target[self::REF_SHARE_TWITTER] ) echo ' checked="checked"'; ?> />
634
+ <label><?php _e( 'Twitter', self::DOMAIN ); ?></label>
635
  </div>
636
  </td>
637
  </tr>
638
  <tr>
639
+ <th><label><?php _e( 'Custom post types', self::DOMAIN ); ?></label></th>
640
  <td>
641
  <input type="text" class="text" name="share_base_custom_post_types" size="60" value="<?php echo esc_html( implode( ',', $this->share_base_custom_post_types ) ); ?>" />
642
  <br>
643
+ <label><?php _e( 'e.g. aaa, bbb, ccc (comma-delimited)', self::DOMAIN ); ?></label>
644
  </td>
645
  </tr>
646
  <tr>
647
+ <th><label><?php _e( 'Interval cheking share count (sec)', self::DOMAIN ); ?></label></th>
648
  <td>
649
  <input type="text" class="text" name="share_base_check_interval" size="20" value="<?php echo esc_html( $this->share_base_check_interval ); ?>" />
650
+ <label><?php _e( 'Default: 600', self::DOMAIN ); ?></label>
651
  </td>
652
  </tr>
653
  <tr>
654
+ <th><label><?php _e( 'Number of contents to check at a time', self::DOMAIN ); ?></label></th>
655
  <td>
656
  <input type="text" class="text" name="share_base_posts_per_check" size="20" value="<?php echo esc_html( $this->share_base_posts_per_check ); ?>" />
657
+ <label><?php _e( 'Default: 20', self::DOMAIN ); ?></label>
658
  </td>
659
  </tr>
660
  <tr>
661
+ <th><label><?php _e( 'Scheme migration mode from http to https', self::DOMAIN ); ?></label></th>
662
  <td>
663
  <select name="scheme_migration_mode">
664
+ <option value="0"<?php if ( $this->scheme_migration_mode === self::OPT_COMMON_SCHEME_MIGRATION_MODE_OFF ) echo ' selected="selected"'; ?>><?php _e( 'Off', self::DOMAIN ); ?></option>
665
+ <option value="1"<?php if ( $this->scheme_migration_mode === self::OPT_COMMON_SCHEME_MIGRATION_MODE_ON ) echo ' selected="selected"'; ?>><?php _e( 'On', self::DOMAIN ); ?></option>
666
  </select>
667
+ <label><?php _e('Default: Off', self::DOMAIN ); ?></label>
668
  </td>
669
  </tr>
670
  <?php if ( $this->scheme_migration_mode ) { ?>
671
  <tr>
672
+ <th><label><?php _e( 'Scheme migration date from http to https', self::DOMAIN ); ?></label></th>
673
  <td>
674
  <input id="scheme-migration-date" type="text" class="text" name="scheme_migration_date" size="20" value="<?php echo esc_html( $this->scheme_migration_date ); ?>" />
675
+ <label><?php _e( 'Default: N/A', self::DOMAIN ); ?></label>
676
  <script>
677
  jQuery(document).ready(function() {
678
  jQuery('#scheme-migration-date').datepicker({
685
  <?php } ?>
686
  </table>
687
  <div class="submit-button">
688
+ <input type="submit" class="button button-primary" name="update_all_options" value="<?php _e( 'Update All Options', self::DOMAIN ); ?>" />
689
+ <input type="submit" class="button" name="clear_share_base_cache" value="<?php _e( 'Clear Cache', self::DOMAIN ); ?>">
690
  </div>
691
  </div>
692
  </div>
693
  <div id="share-rush-cache" class="postbox">
694
  <div class="handlediv" title="Click to toggle"><br></div>
695
+ <h3 class="hndle"><span><?php _e( 'Share Rush Cache', self::DOMAIN); ?></span></h3>
696
  <div class="inside">
697
  <table class="form-table">
698
  <tr>
699
+ <th><label><?php _e( 'Term considering posted content as new content', self::DOMAIN ); ?></label></th>
700
  <td>
701
  <select name="share_rush_new_content_term">
702
+ <option value="1"<?php if ( $this->share_rush_new_content_term === 1 ) echo ' selected="selected"'; ?>><?php _e( '1 day', self::DOMAIN ); ?></option>
703
+ <option value="2"<?php if ( $this->share_rush_new_content_term === 2 ) echo ' selected="selected"'; ?>><?php _e( '2 days', self::DOMAIN ); ?></option>
704
+ <option value="3"<?php if ( $this->share_rush_new_content_term === 3 ) echo ' selected="selected"'; ?>><?php _e( '3 days', self::DOMAIN ); ?></option>
705
+ <option value="4"<?php if ( $this->share_rush_new_content_term === 4 ) echo ' selected="selected"'; ?>><?php _e( '4 days', self::DOMAIN ); ?></option>
706
+ <option value="5"<?php if ( $this->share_rush_new_content_term === 5 ) echo ' selected="selected"'; ?>><?php _e( '5 days', self::DOMAIN ); ?></option>
707
+ <option value="6"<?php if ( $this->share_rush_new_content_term === 6 ) echo ' selected="selected"'; ?>><?php _e( '6 days', self::DOMAIN ); ?></option>
708
+ <option value="7"<?php if ( $this->share_rush_new_content_term === 7 ) echo ' selected="selected"'; ?>><?php _e( '7 days', self::DOMAIN ); ?></option>
709
+ <option value="8"<?php if ( $this->share_rush_new_content_term === 8 ) echo ' selected="selected"'; ?>><?php _e( '8 days', self::DOMAIN ); ?></option>
710
+ <option value="9"<?php if ( $this->share_rush_new_content_term === 9 ) echo ' selected="selected"'; ?>><?php _e( '9 days', self::DOMAIN ); ?></option>
711
+ <option value="10"<?php if ( $this->share_rush_new_content_term === 10 ) echo ' selected="selected"'; ?>><?php _e( '10 days', self::DOMAIN ); ?></option>
712
+ <option value="11"<?php if ( $this->share_rush_new_content_term === 11 ) echo ' selected="selected"'; ?>><?php _e( '11 days', self::DOMAIN ); ?></option>
713
+ <option value="12"<?php if ( $this->share_rush_new_content_term === 12 ) echo ' selected="selected"'; ?>><?php _e( '12 days', self::DOMAIN ); ?></option>
714
+ <option value="13"<?php if ( $this->share_rush_new_content_term === 13 ) echo ' selected="selected"'; ?>><?php _e( '13 days', self::DOMAIN ); ?></option>
715
+ <option value="14"<?php if ( $this->share_rush_new_content_term === 14 ) echo ' selected="selected"'; ?>><?php _e( '14 days', self::DOMAIN ); ?></option>
716
  </select>
717
+ <label><?php _e( 'Default: 3 days', self::DOMAIN ); ?></label>
718
  </td>
719
  </tr>
720
 
721
  <tr>
722
+ <th><label><?php _e( 'Interval cheking share count (sec)', self::DOMAIN ); ?></label></th>
723
  <td>
724
  <?php
725
+ echo esc_html( $this->share_rush_check_interval ) . ' ' . __( 'seconds', self::DOMAIN );
726
  ?>
727
  </td>
728
  </tr>
729
 
730
  </table>
731
  <div class="submit-button">
732
+ <input type="submit" class="button button-primary" name="update_all_options" value="<?php _e( 'Update All Options', self::DOMAIN ); ?>" />
733
  </div>
734
  </div>
735
  </div>
736
  <div id="share-variation-analysis" class="postbox">
737
  <div class="handlediv" title="Click to toggle"><br></div>
738
+ <h3 class="hndle"><span><?php _e('Share Variation Analysis', self::DOMAIN); ?></span></h3>
739
  <div class="inside">
740
  <table class="form-table">
741
  <tr>
742
+ <th><label><?php _e( 'Method to update basis of comparison', self::DOMAIN ); ?></label></th>
743
  <td>
744
  <select name="share_variation_analysis_mode">
745
+ <option value="1"<?php if ( $this->share_variation_analysis_mode === self::OPT_SHARE_VARIATION_ANALYSIS_NONE ) echo ' selected="selected"'; ?>><?php _e( 'Disabled (None)', self::DOMAIN ); ?></option>
746
+ <option value="2"<?php if ( $this->share_variation_analysis_mode === self::OPT_SHARE_VARIATION_ANALYSIS_MANUAL ) echo ' selected="selected"'; ?>><?php _e( 'Enabled (Manual)', self::DOMAIN ); ?></option>
747
+ <option value="3"<?php if ( $this->share_variation_analysis_mode === self::OPT_SHARE_VARIATION_ANALYSIS_SCHEDULER ) echo ' selected="selected"'; ?>><?php _e( 'Enabled (Scheduler)', self::DOMAIN ); ?></option>
748
  </select>
749
+ <label><?php _e( 'Default: None', self::DOMAIN ); ?></label>
750
  </td>
751
  </tr>
752
 
806
  <td>
807
  <select name="a_moncronmday">
808
  <?php for ( $i = 1; $i <= 31; $i ++ ) {
809
+ $on_day = '';
810
+ switch ( $i ) {
811
+ case 1:
812
+ $on_day = __( 'on 1.', self::DOMAIN );
813
+ break;
814
+ case 2:
815
+ $on_day = __( 'on 2.', self::DOMAIN );
816
+ break;
817
+ case 3:
818
+ $on_day = __( 'on 3.', self::DOMAIN );
819
+ break;
820
+ case 4:
821
+ $on_day = __( 'on 4.', self::DOMAIN );
822
+ break;
823
+ case 5:
824
+ $on_day = __( 'on 5.', self::DOMAIN );
825
+ break;
826
+ case 6:
827
+ $on_day = __( 'on 6.', self::DOMAIN );
828
+ break;
829
+ case 7:
830
+ $on_day = __( 'on 7.', self::DOMAIN );
831
+ break;
832
+ case 8:
833
+ $on_day = __( 'on 8.', self::DOMAIN );
834
+ break;
835
+ case 9:
836
+ $on_day = __( 'on 9.', self::DOMAIN );
837
+ break;
838
+ case 10:
839
+ $on_day = __( 'on 10.', self::DOMAIN );
840
+ break;
841
+ case 11:
842
+ $on_day = __( 'on 11.', self::DOMAIN );
843
+ break;
844
+ case 12:
845
+ $on_day = __( 'on 12.', self::DOMAIN );
846
+ break;
847
+ case 13:
848
+ $on_day = __( 'on 13.', self::DOMAIN );
849
+ break;
850
+ case 14:
851
+ $on_day = __( 'on 14.', self::DOMAIN );
852
+ break;
853
+ case 15:
854
+ $on_day = __( 'on 15.', self::DOMAIN );
855
+ break;
856
+ case 16:
857
+ $on_day = __( 'on 16.', self::DOMAIN );
858
+ break;
859
+ case 17:
860
+ $on_day = __( 'on 17.', self::DOMAIN );
861
+ break;
862
+ case 18:
863
+ $on_day = __( 'on 18.', self::DOMAIN );
864
+ break;
865
+ case 19:
866
+ $on_day = __( 'on 19.', self::DOMAIN );
867
+ break;
868
+ case 20:
869
+ $on_day = __( 'on 20.', self::DOMAIN );
870
+ break;
871
+ case 21:
872
+ $on_day = __( 'on 21.', self::DOMAIN );
873
+ break;
874
+ case 22:
875
+ $on_day = __( 'on 22.', self::DOMAIN );
876
+ break;
877
+ case 23:
878
+ $on_day = __( 'on 23.', self::DOMAIN );
879
+ break;
880
+ case 24:
881
+ $on_day = __( 'on 24.', self::DOMAIN );
882
+ break;
883
+ case 25:
884
+ $on_day = __( 'on 25.', self::DOMAIN );
885
+ break;
886
+ case 26:
887
+ $on_day = __( 'on 26.', self::DOMAIN );
888
+ break;
889
+ case 27:
890
+ $on_day = __( 'on 27.', self::DOMAIN );
891
+ break;
892
+ case 28:
893
+ $on_day = __( 'on 28.', self::DOMAIN );
894
+ break;
895
+ case 29:
896
+ $on_day = __( 'on 29.', self::DOMAIN );
897
+ break;
898
+ case 30:
899
+ $on_day = __( 'on 30.', self::DOMAIN );
900
+ break;
901
+ case 31:
902
+ $on_day = __( 'on 31.', self::DOMAIN );
903
+ break;
904
+ }
905
+
906
+ echo '<option ' . selected( in_array( "$i", $mday, TRUE ), TRUE, FALSE ) . ' value="' . $i . '" />' . $on_day . '</option>';
907
  } ?>
908
  </select>
909
  </td>
984
  ?>
985
  </table>
986
  <div class="submit-button">
987
+ <input type="submit" class="button button-primary" name="update_all_options" value="<?php _e( 'Update All Options', self::DOMAIN ); ?>" />
988
+ <input type="submit" class="button" name="update_share_comparison_base" value="<?php _e( 'Update Basis of Comparison', self::DOMAIN ); ?>" />
989
  </div>
990
  </div>
991
  </div>
992
  <div id="follow-base-cache" class="postbox">
993
  <div class="handlediv" title="Click to toggle"><br></div>
994
+ <h3 class="hndle"><span><?php _e( 'Follow Base Cache', self::DOMAIN ); ?></span></h3>
995
  <div class="inside">
996
  <table class="form-table">
997
  <tr>
998
+ <th><label><?php _e( 'Target SNS', self::DOMAIN ); ?></label></th>
999
  <td>
1000
  <div class="sns-check">
1001
  <input type="checkbox" value="1" name="follow_base_cache_target_feedly"<?php if ( $this->follow_base_cache_target[self::REF_FOLLOW_FEEDLY] ) echo ' checked="checked"'; ?> />
1002
+ <label><?php _e( 'Feedly', self::DOMAIN ); ?></label>
1003
  </div>
1004
  </td>
1005
  </tr>
1006
  <tr>
1007
+ <th><label><?php _e( 'Interval cheking follower count (sec)', self::DOMAIN ); ?></label></th>
1008
  <td>
1009
  <input type="text" class="text" name="follow_base_check_interval" size="20" value="<?php echo esc_html( $this->follow_base_check_interval); ?>" />
1010
+ <label><?php _e( 'Default: 86400 Minimum: 3600', self::DOMAIN ); ?></label>
1011
  </td>
1012
  </tr>
1013
  </table>
1014
  <div class="submit-button">
1015
+ <input type="submit" class="button button-primary" name="update_all_options" value="<?php _e( 'Update All Options', self::DOMAIN ); ?>" />
1016
+ <input type="submit" class="button" name="clear_follow_base_cache" value="<?php _e( 'Clear Cache', self::DOMAIN ); ?>">
1017
+ </div>
1018
+ </div>
1019
+ </div>
1020
+ <?php if ( $this->follow_base_cache_target[self::REF_FOLLOW_FEEDLY] ) { ?>
1021
+ <div id="follow-base-cache-feedly" class="postbox">
1022
+ <div class="handlediv" title="Click to toggle"><br></div>
1023
+ <h3 class="hndle"><span><?php _e( 'Follow Base Cache - Feedly', self::DOMAIN ); ?></span></h3>
1024
+ <div class="inside">
1025
+ <table class="form-table">
1026
+ <tr>
1027
+ <th><label><?php _e( 'Target feed type', self::DOMAIN ); ?></label></th>
1028
+ <td>
1029
+ <select name="follow_feed_type">
1030
+ <option value="default"<?php if ( $this->follow_feed_type === self::OPT_FEED_TYPE_DEFAULT ) echo ' selected="selected"'; ?>><?php _e( 'Default', self::DOMAIN ) ?></option>
1031
+ <option value="rss"<?php if ( $this->follow_feed_type === self::OPT_FEED_TYPE_RSS ) echo ' selected="selected"'; ?>><?php _e( 'RSS', self::DOMAIN ); ?></option>
1032
+ <option value="rss2"<?php if ( $this->follow_feed_type === self::OPT_FEED_TYPE_RSS2 ) echo ' selected="selected"'; ?>><?php _e( 'RSS2', self::DOMAIN ); ?></option>
1033
+ <option value="rdf"<?php if ( $this->follow_feed_type === self::OPT_FEED_TYPE_RDF ) echo ' selected="selected"'; ?>><?php _e( 'RDF', self::DOMAIN ); ?></option>
1034
+ <option value="atom"<?php if ( $this->follow_feed_type === self::OPT_FEED_TYPE_ATOM ) echo ' selected="selected"'; ?>><?php _e( 'ATOM', self::DOMAIN ); ?></option>
1035
+ </select>
1036
+ <label><?php _e( 'Default: Default', self::DOMAIN ); ?></label>
1037
+ </td>
1038
+ </tr>
1039
+ <tr>
1040
+ <th><label><?php _e( 'Target feed', self::DOMAIN ); ?></label></th>
1041
+ <td><?php echo get_feed_link( $this->follow_feed_type ); ?></td>
1042
+ </tr>
1043
+ </table>
1044
+ <div class="submit-button">
1045
+ <input type="submit" class="button button-primary" name="update_all_options" value="<?php _e( 'Update All Options', self::DOMAIN ); ?>" />
1046
  </div>
1047
  </div>
1048
+ </div>
1049
+ <?php } ?>
1050
  <div id="common-dynamic-cache" class="postbox">
1051
  <div class="handlediv" title="Click to toggle"><br></div>
1052
+ <h3 class="hndle"><span><?php _e( 'Dynamic Cache', self::DOMAIN ); ?></span></h3>
1053
  <div class="inside">
1054
  <table class="form-table">
1055
  <tr>
1056
+ <th><label><?php _e( 'Dynamic caching based on user access', self::DOMAIN ); ?></label></th>
1057
  <td>
1058
  <select name="dynamic_cache_mode">
1059
+ <option value="1"<?php if ( $this->dynamic_cache_mode === self::OPT_COMMON_ACCESS_BASED_CACHE_NONE ) echo ' selected="selected"'; ?>><?php _e( 'Disabled (None)', self::DOMAIN ); ?></option>
1060
+ <option value="2"<?php if ( $this->dynamic_cache_mode === self::OPT_COMMON_ACCESS_BASED_SYNC_CACHE ) echo ' selected="selected"'; ?>><?php _e( 'Enabled (Synchronous Cache)', self::DOMAIN ); ?></option>
1061
+ <option value="3"<?php if ( $this->dynamic_cache_mode === self::OPT_COMMON_ACCESS_BASED_ASYNC_CACHE ) echo ' selected="selected"'; ?>><?php _e( 'Enabled (Asynchronous Cache)', self::DOMAIN ); ?></option>
1062
+ <option value="4"<?php if ( $this->dynamic_cache_mode === self::OPT_COMMON_ACCESS_BASED_2ND_CACHE ) echo ' selected="selected"'; ?>><?php _e( 'Enabled (Asynchronous 2nd Cache)', self::DOMAIN ); ?></option>
1063
  </select>
1064
+ <label><?php _e( 'Default: Enabled (Asynchronous 2nd Cache)', self::DOMAIN ); ?></label>
1065
  </td>
1066
  </tr>
1067
  </table>
1068
  <div class="submit-button">
1069
+ <input type="submit" class="button button-primary" name="update_all_options" value="<?php _e( 'Update All Options', self::DOMAIN ); ?>" />
1070
  </div>
1071
  </div>
1072
  </div>
1073
  <div id="common-data-crawler" class="postbox">
1074
  <div class="handlediv" title="Click to toggle"><br></div>
1075
+ <h3 class="hndle"><span><?php _e( 'Data Crawler', self::DOMAIN ); ?></span></h3>
1076
  <div class="inside">
1077
  <table class="form-table">
1078
  <tr>
1079
+ <th><label><?php _e( 'Crawl method', self::DOMAIN ); ?></label></th>
1080
  <td>
1081
  <?php
1082
  switch ( $this->crawler_method ) {
1091
  </td>
1092
  </tr>
1093
  <tr>
1094
+ <th><label><?php _e( 'SSL verification', self::DOMAIN ); ?></label></th>
1095
  <td>
1096
  <select name="crawler_ssl_verification">
1097
+ <option value="0"<?php if ( $this->crawler_ssl_verification === self::OPT_COMMON_CRAWLER_SSL_VERIFY_OFF ) echo ' selected="selected"'; ?>><?php _e( 'Off', self::DOMAIN ); ?></option>
1098
+ <option value="1"<?php if ( $this->crawler_ssl_verification === self::OPT_COMMON_CRAWLER_SSL_VERIFY_ON ) echo ' selected="selected"'; ?>><?php _e( 'On', self::DOMAIN ); ?></option>
1099
  </select>
1100
+ <label><?php _e( 'Default: On', self::DOMAIN ); ?></label>
1101
  </td>
1102
  </tr>
1103
  </table>
1104
  <div class="submit-button">
1105
+ <input type="submit" class="button button-primary" name="update_all_options" value="<?php _e( 'Update All Options', self::DOMAIN ); ?>" />
1106
  </div>
1107
  </div>
1108
  </div>
1109
  <div id="common-data-export" class="postbox">
1110
  <div class="handlediv" title="Click to toggle"><br></div>
1111
+ <h3 class="hndle"><span><?php _e( 'Data Export', self::DOMAIN ); ?></span></h3>
1112
  <div class="inside">
1113
  <table class="form-table">
1114
  <tr>
1115
+ <th><label><?php _e( 'Method of data export', self::DOMAIN ); ?></label></th>
1116
  <td>
1117
  <select name="data_export_mode">
1118
+ <option value="1"<?php if ( $this->data_export_mode === self::OPT_COMMON_DATA_EXPORT_MANUAL ) echo ' selected="selected"'; ?>><?php _e( 'Manual', self::DOMAIN ); ?></option>
1119
+ <option value="2"<?php if ( $this->data_export_mode === self::OPT_COMMON_DATA_EXPORT_SCHEDULER ) echo ' selected="selected"'; ?> disabled="disabled"><?php _e( 'Scheduler', self::DOMAIN ); ?></option>
1120
  </select>
1121
+ <label><?php _e( 'Default: Manual', self::DOMAIN ); ?></label>
1122
  </td>
1123
  </tr>
1124
  <?php
1177
  <td>
1178
  <select name="e_moncronmday">
1179
  <?php for ( $i = 1; $i <= 31; $i ++ ) {
1180
+ $on_day = '';
1181
+ switch ( $i ) {
1182
+ case 1:
1183
+ $on_day = __( 'on 1.', self::DOMAIN );
1184
+ break;
1185
+ case 2:
1186
+ $on_day = __( 'on 2.', self::DOMAIN );
1187
+ break;
1188
+ case 3:
1189
+ $on_day = __( 'on 3.', self::DOMAIN );
1190
+ break;
1191
+ case 4:
1192
+ $on_day = __( 'on 4.', self::DOMAIN );
1193
+ break;
1194
+ case 5:
1195
+ $on_day = __( 'on 5.', self::DOMAIN );
1196
+ break;
1197
+ case 6:
1198
+ $on_day = __( 'on 6.', self::DOMAIN );
1199
+ break;
1200
+ case 7:
1201
+ $on_day = __( 'on 7.', self::DOMAIN );
1202
+ break;
1203
+ case 8:
1204
+ $on_day = __( 'on 8.', self::DOMAIN );
1205
+ break;
1206
+ case 9:
1207
+ $on_day = __( 'on 9.', self::DOMAIN );
1208
+ break;
1209
+ case 10:
1210
+ $on_day = __( 'on 10.', self::DOMAIN );
1211
+ break;
1212
+ case 11:
1213
+ $on_day = __( 'on 11.', self::DOMAIN );
1214
+ break;
1215
+ case 12:
1216
+ $on_day = __( 'on 12.', self::DOMAIN );
1217
+ break;
1218
+ case 13:
1219
+ $on_day = __( 'on 13.', self::DOMAIN );
1220
+ break;
1221
+ case 14:
1222
+ $on_day = __( 'on 14.', self::DOMAIN );
1223
+ break;
1224
+ case 15:
1225
+ $on_day = __( 'on 15.', self::DOMAIN );
1226
+ break;
1227
+ case 16:
1228
+ $on_day = __( 'on 16.', self::DOMAIN );
1229
+ break;
1230
+ case 17:
1231
+ $on_day = __( 'on 17.', self::DOMAIN );
1232
+ break;
1233
+ case 18:
1234
+ $on_day = __( 'on 18.', self::DOMAIN );
1235
+ break;
1236
+ case 19:
1237
+ $on_day = __( 'on 19.', self::DOMAIN );
1238
+ break;
1239
+ case 20:
1240
+ $on_day = __( 'on 20.', self::DOMAIN );
1241
+ break;
1242
+ case 21:
1243
+ $on_day = __( 'on 21.', self::DOMAIN );
1244
+ break;
1245
+ case 22:
1246
+ $on_day = __( 'on 22.', self::DOMAIN );
1247
+ break;
1248
+ case 23:
1249
+ $on_day = __( 'on 23.', self::DOMAIN );
1250
+ break;
1251
+ case 24:
1252
+ $on_day = __( 'on 24.', self::DOMAIN );
1253
+ break;
1254
+ case 25:
1255
+ $on_day = __( 'on 25.', self::DOMAIN );
1256
+ break;
1257
+ case 26:
1258
+ $on_day = __( 'on 26.', self::DOMAIN );
1259
+ break;
1260
+ case 27:
1261
+ $on_day = __( 'on 27.', self::DOMAIN );
1262
+ break;
1263
+ case 28:
1264
+ $on_day = __( 'on 28.', self::DOMAIN );
1265
+ break;
1266
+ case 29:
1267
+ $on_day = __( 'on 29.', self::DOMAIN );
1268
+ break;
1269
+ case 30:
1270
+ $on_day = __( 'on 30.', self::DOMAIN );
1271
+ break;
1272
+ case 31:
1273
+ $on_day = __( 'on 31.', self::DOMAIN );
1274
+ break;
1275
+ }
1276
+
1277
+ echo '<option ' . selected( in_array( "$i", $mday, TRUE ), TRUE, FALSE ) . ' value="' . $i . '" />' . $on_day . '</option>';
1278
  } ?>
1279
  </select>
1280
  </td>
1371
  ?>
1372
  </table>
1373
  <div class="submit-button">
1374
+ <input type="submit" class="button button-primary" name="update_all_options" value="<?php _e( 'Update All Options', self::DOMAIN ); ?>" />
1375
  </div>
1376
  </div>
1377
  </div>
1380
  <div class="metabox-holder">
1381
  <div id="common-exported-file" class="postbox">
1382
  <div class="handlediv" title="Click to toggle"><br></div>
1383
+ <h3 class="hndle"><span><?php _e( 'Exported File', self::DOMAIN ); ?></span></h3>
1384
  <div class="inside">
1385
  <table class="form-table">
1386
  <tbody>
1387
  <tr>
1388
+ <th><?php _e( 'Disk usage of exported file', self::DOMAIN ); ?></th>
1389
  <td>
1390
  <?php
1391
  $abs_path = WP_PLUGIN_DIR . '/sns-count-cache/data/sns-count-cache-data.csv';
1394
  if ( isset( $file_size ) ) {
1395
  echo $file_size;
1396
  } else {
1397
+ _e( 'No exported file', self::DOMAIN );
1398
  }
1399
  ?>
1400
  </td>
1406
  <table class="form-table">
1407
  <tbody>
1408
  <tr>
1409
+ <th><?php _e( 'Manual export', self::DOMAIN ); ?></th>
1410
  <td>
1411
+ <input type="submit" class="button" name="export_data" value="<?php _e( 'Export', self::DOMAIN ); ?>" />
1412
  <br>
1413
+ <span class="description"><?php _e( 'Export share count to a csv file.', self::DOMAIN ); ?></span>
1414
  </td>
1415
  </tr>
1416
  </tbody>
1424
  <table class="form-table">
1425
  <tbody>
1426
  <tr>
1427
+ <th><?php _e( 'Reset of exported file', self::DOMAIN ); ?></th>
1428
  <td>
1429
+ <input type="submit" class="button" name="reset_data" value="<?php _e( 'Reset', self::DOMAIN ); ?>" />
1430
  <br>
1431
+ <span class="description"><?php _e( 'Clear exported csv file.', self::DOMAIN ); ?></span>
1432
  </td>
1433
  </tr>
1434
  </tbody>
1439
  <table class="form-table">
1440
  <tbody>
1441
  <tr>
1442
+ <th><?php _e( 'Download of exported file', self::DOMAIN ); ?></th>
1443
  <td>
1444
+ <input type="submit" class="button" name="download_data" value="<?php _e( 'Download', self::DOMAIN ); ?>" />
1445
  <br>
1446
+ <span class="description"><?php _e( 'Download the exported csv file.', self::DOMAIN ); ?></span>
1447
  </td>
1448
  </tr>
1449
  </tbody>
includes/admin-share-count.php CHANGED
@@ -66,31 +66,31 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
66
 
67
  ?>
68
  <div class="wrap">
69
- <h2><a href="admin.php?page=scc-share-count"><?php _e( 'SNS Count Cache', self::DOMAIN ) ?></a></h2>
70
  <div class="sns-cnt-cache">
71
  <h3 class="nav-tab-wrapper">
72
- <a class="nav-tab" href="admin.php?page=scc-dashboard"><?php _e( 'Dashboard', self::DOMAIN ) ?></a>
73
- <a class="nav-tab" href="admin.php?page=scc-cache-status"><?php _e( 'Cache Status', self::DOMAIN ) ?></a>
74
- <a class="nav-tab nav-tab-active" href="admin.php?page=scc-share-count"><?php _e( 'Share Count', self::DOMAIN ) ?></a>
75
  <?php if ( $this->share_variation_analysis_mode !== self::OPT_SHARE_VARIATION_ANALYSIS_NONE ) { ?>
76
- <a class="nav-tab" href="admin.php?page=scc-hot-content"><?php _e( 'Hot Content', self::DOMAIN ) ?></a>
77
  <?php } ?>
78
- <a class="nav-tab" href="admin.php?page=scc-setting"><?php _e( 'Setting', self::DOMAIN ) ?></a>
79
- <a class="nav-tab" href="admin.php?page=scc-help"><?php _e( 'Help', self::DOMAIN ) ?></a>
80
  </h3>
81
  <div class="metabox-holder">
82
  <div id="share-each-content" class="postbox">
83
  <div class="handlediv" title="Click to toggle"><br></div>
84
- <h3 class="hndle"><span><?php _e( 'Share Count', self::DOMAIN ) ?></span></h3>
85
  <div class="inside">
86
  <table class="view-table">
87
  <thead>
88
  <tr>
89
  <th>No.</th>
90
- <th><?php _e( 'Content', self::DOMAIN ) ?></th>
91
  <?php
92
 
93
- foreach ( $share_base_cache_target as $sns => $active ){
94
 
95
  if ( $active ) {
96
 
@@ -101,11 +101,34 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
101
  }
102
 
103
  $sort_url = esc_url( 'admin.php?page=scc-share-count&action=sort&key=' . $sort_key );
104
-
105
- if ( $sns === $sort_exec_key ){
106
- echo '<th><a class="sort-exec-key" href="' . $sort_url . '">' . esc_html( $sns ) . '</th>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  } else {
108
- echo '<th><a href="' . $sort_url . '">' . esc_html( $sns ) . '</th>';
109
  }
110
  }
111
  }
66
 
67
  ?>
68
  <div class="wrap">
69
+ <h2><a href="admin.php?page=scc-share-count"><?php _e( 'SNS Count Cache', self::DOMAIN ); ?></a></h2>
70
  <div class="sns-cnt-cache">
71
  <h3 class="nav-tab-wrapper">
72
+ <a class="nav-tab" href="admin.php?page=scc-dashboard"><?php _e( 'Dashboard', self::DOMAIN ); ?></a>
73
+ <a class="nav-tab" href="admin.php?page=scc-cache-status"><?php _e( 'Cache Status', self::DOMAIN ); ?></a>
74
+ <a class="nav-tab nav-tab-active" href="admin.php?page=scc-share-count"><?php _e( 'Share Count', self::DOMAIN ); ?></a>
75
  <?php if ( $this->share_variation_analysis_mode !== self::OPT_SHARE_VARIATION_ANALYSIS_NONE ) { ?>
76
+ <a class="nav-tab" href="admin.php?page=scc-hot-content"><?php _e( 'Hot Content', self::DOMAIN ); ?></a>
77
  <?php } ?>
78
+ <a class="nav-tab" href="admin.php?page=scc-setting"><?php _e( 'Setting', self::DOMAIN ); ?></a>
79
+ <a class="nav-tab" href="admin.php?page=scc-help"><?php _e( 'Help', self::DOMAIN ); ?></a>
80
  </h3>
81
  <div class="metabox-holder">
82
  <div id="share-each-content" class="postbox">
83
  <div class="handlediv" title="Click to toggle"><br></div>
84
+ <h3 class="hndle"><span><?php _e( 'Share Count', self::DOMAIN ); ?></span></h3>
85
  <div class="inside">
86
  <table class="view-table">
87
  <thead>
88
  <tr>
89
  <th>No.</th>
90
+ <th><?php _e( 'Content', self::DOMAIN ); ?></th>
91
  <?php
92
 
93
+ foreach ( $share_base_cache_target as $sns => $active ) {
94
 
95
  if ( $active ) {
96
 
101
  }
102
 
103
  $sort_url = esc_url( 'admin.php?page=scc-share-count&action=sort&key=' . $sort_key );
104
+
105
+ $sns_name = '';
106
+
107
+ switch ( $sns ) {
108
+ case self::REF_SHARE_TWITTER:
109
+ $sns_name = __( 'Twitter', self::DOMAIN );
110
+ break;
111
+ case self::REF_SHARE_FACEBOOK:
112
+ $sns_name = __( 'Facebook', self::DOMAIN );
113
+ break;
114
+ case self::REF_SHARE_GPLUS:
115
+ $sns_name = __( 'Google+', self::DOMAIN );
116
+ break;
117
+ case self::REF_SHARE_POCKET:
118
+ $sns_name = __( 'Pocket', self::DOMAIN );
119
+ break;
120
+ case self::REF_SHARE_HATEBU:
121
+ $sns_name = __( 'Hatebu', self::DOMAIN );
122
+ break;
123
+ case self::REF_SHARE_TOTAL:
124
+ $sns_name = __( 'Total', self::DOMAIN );
125
+ break;
126
+ }
127
+
128
+ if ( $sns === $sort_exec_key ) {
129
+ echo '<th><a class="sort-exec-key" href="' . $sort_url . '">' . esc_html( $sns_name ) . '</th>';
130
  } else {
131
+ echo '<th><a href="' . $sort_url . '">' . esc_html( $sns_name ) . '</th>';
132
  }
133
  }
134
  }
includes/class-cache-engine.php CHANGED
@@ -40,7 +40,17 @@ abstract class Cache_Engine extends Engine {
40
  /**
41
  * instance for delegation
42
  */
43
- protected $delegate = NULL;
 
 
 
 
 
 
 
 
 
 
44
 
45
  /**
46
  * Get cache expiration based on current number of total post and page
40
  /**
41
  * instance for delegation
42
  */
43
+ protected $delegate = NULL;
44
+
45
+ /**
46
+ * retry of cache processing
47
+ */
48
+ protected $cache_retry = false;
49
+
50
+ /**
51
+ * limit of cache retry
52
+ */
53
+ protected $retry_limit = 3;
54
 
55
  /**
56
  * Get cache expiration based on current number of total post and page
includes/class-data-crawler.php CHANGED
@@ -50,6 +50,16 @@ abstract class Data_Crawler {
50
  * ssl verification
51
  */
52
  protected $ssl_verification = true;
 
 
 
 
 
 
 
 
 
 
53
 
54
  /**
55
  * Instance
50
  * ssl verification
51
  */
52
  protected $ssl_verification = true;
53
+
54
+ /**
55
+ * retry flag
56
+ */
57
+ protected $crawl_retry = false;
58
+
59
+ /**
60
+ * limit of crawl retry
61
+ */
62
+ protected $retry_limit = 2;
63
 
64
  /**
65
  * Instance
includes/class-follow-base-cache-engine.php CHANGED
@@ -61,6 +61,11 @@ class Follow_Base_Cache_Engine extends Follow_Cache_Engine {
61
  * Interval cheking and caching target data
62
  */
63
  private $check_interval = 600;
 
 
 
 
 
64
 
65
  /**
66
  * Offset suffix
@@ -79,7 +84,9 @@ class Follow_Base_Cache_Engine extends Follow_Cache_Engine {
79
  $this->prime_cron = self::DEF_PRIME_CRON;
80
  $this->execute_cron = self::DEF_EXECUTE_CRON;
81
  $this->event_schedule = self::DEF_EVENT_SCHEDULE;
82
- $this->event_description = self::DEF_EVENT_DESCRIPTION;
 
 
83
 
84
  if ( isset( $options['delegate'] ) ) $this->delegate = $options['delegate'];
85
  if ( isset( $options['crawler'] ) ) $this->crawler = $options['crawler'];
@@ -92,7 +99,10 @@ class Follow_Base_Cache_Engine extends Follow_Cache_Engine {
92
  if ( isset( $options['event_description'] ) ) $this->event_description = $options['event_description'];
93
  if ( isset( $options['scheme_migration_mode'] ) ) $this->scheme_migration_mode = $options['scheme_migration_mode'];
94
  if ( isset( $options['scheme_migration_exclude_keys'] ) ) $this->scheme_migration_exclude_keys = $options['scheme_migration_exclude_keys'];
95
-
 
 
 
96
  add_filter( 'cron_schedules', array( $this, 'schedule_check_interval' ) );
97
  add_action( $this->prime_cron, array( $this, 'prime_cache' ) );
98
  add_action( $this->execute_cron, array( $this, 'execute_cache' ), 10, 1 );
@@ -145,7 +155,7 @@ class Follow_Base_Cache_Engine extends Follow_Cache_Engine {
145
 
146
  Common_Util::log( '[' . __METHOD__ . '] cache_expiration: ' . $cache_expiration );
147
 
148
- $url = get_feed_link();
149
 
150
  $transient_id = $this->get_cache_key( 'follow' );
151
 
61
  * Interval cheking and caching target data
62
  */
63
  private $check_interval = 600;
64
+
65
+ /**
66
+ * Feed type
67
+ */
68
+ private $feed_type = '';
69
 
70
  /**
71
  * Offset suffix
84
  $this->prime_cron = self::DEF_PRIME_CRON;
85
  $this->execute_cron = self::DEF_EXECUTE_CRON;
86
  $this->event_schedule = self::DEF_EVENT_SCHEDULE;
87
+ $this->event_description = self::DEF_EVENT_DESCRIPTION;
88
+
89
+ $this->load_ratio = 0.5;
90
 
91
  if ( isset( $options['delegate'] ) ) $this->delegate = $options['delegate'];
92
  if ( isset( $options['crawler'] ) ) $this->crawler = $options['crawler'];
99
  if ( isset( $options['event_description'] ) ) $this->event_description = $options['event_description'];
100
  if ( isset( $options['scheme_migration_mode'] ) ) $this->scheme_migration_mode = $options['scheme_migration_mode'];
101
  if ( isset( $options['scheme_migration_exclude_keys'] ) ) $this->scheme_migration_exclude_keys = $options['scheme_migration_exclude_keys'];
102
+ if ( isset( $options['feed_type'] ) ) $this->feed_type = $options['feed_type'];
103
+ if ( isset( $options['cache_retry'] ) ) $this->cache_retry = $options['cache_retry'];
104
+ if ( isset( $options['retry_limit'] ) ) $this->retry_limit = $options['retry_limit'];
105
+
106
  add_filter( 'cron_schedules', array( $this, 'schedule_check_interval' ) );
107
  add_action( $this->prime_cron, array( $this, 'prime_cache' ) );
108
  add_action( $this->execute_cron, array( $this, 'execute_cache' ), 10, 1 );
155
 
156
  Common_Util::log( '[' . __METHOD__ . '] cache_expiration: ' . $cache_expiration );
157
 
158
+ $url = get_feed_link( $this->feed_type );
159
 
160
  $transient_id = $this->get_cache_key( 'follow' );
161
 
includes/class-follow-cache-engine.php CHANGED
@@ -51,7 +51,12 @@ abstract class Follow_Cache_Engine extends Cache_Engine {
51
  * excluded keys in scheme migration
52
  */
53
  protected $scheme_migration_exclude_keys = array();
54
-
 
 
 
 
 
55
  /**
56
  * Get and cache data for a given post
57
  *
@@ -93,12 +98,54 @@ abstract class Follow_Cache_Engine extends Cache_Engine {
93
  }
94
 
95
  }
96
-
97
- if ( $data ) {
98
- $result = set_transient( $cache_key, $data, $cache_expiration );
 
 
 
 
99
 
100
- Common_Util::log( '[' . __METHOD__ . '] set_transient result: ' . $result );
101
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
 
103
  return $data;
104
  }
51
  * excluded keys in scheme migration
52
  */
53
  protected $scheme_migration_exclude_keys = array();
54
+
55
+ /**
56
+ * load ratio for throttle
57
+ */
58
+ protected $load_ratio = 0.5;
59
+
60
  /**
61
  * Get and cache data for a given post
62
  *
98
  }
99
 
100
  }
101
+
102
+ if ( $data ) {
103
+
104
+ $throttle = new Sleep_Throttle( $this->load_ratio );
105
+
106
+ $throttle->reset();
107
+ $throttle->start();
108
 
109
+ $result = set_transient( $cache_key, $data, $cache_expiration );
110
+
111
+ $throttle->stop();
112
+
113
+ $retry_count = 0;
114
+
115
+ while ( true ) {
116
+
117
+ Common_Util::log( '[' . __METHOD__ . '] set_transient result (' . $cache_key . '): ' . $result );
118
+
119
+ if ( $result ) {
120
+ break;
121
+
122
+ } else {
123
+
124
+ if ( $retry_count < $this->retry_limit ) {
125
+
126
+ Common_Util::log( '[' . __METHOD__ . '] sleep before set_transient retry (' . $cache_key . '): ' . $throttle->get_sleep_time() . ' sec.' );
127
+
128
+ $throttle->sleep();
129
+
130
+ ++$retry_count;
131
+
132
+ Common_Util::log( '[' . __METHOD__ . '] count of set_transient retry (' . $cache_key . '): ' . $retry_count );
133
+
134
+ $throttle->reset();
135
+ $throttle->start();
136
+
137
+ $result = set_transient( $cache_key, $data, $cache_expiration );
138
+
139
+ $throttle->stop();
140
+
141
+ } else {
142
+ Common_Util::log( '[' . __METHOD__ . '] set_transient result (' . $cache_key . '): retry failed' );
143
+ break;
144
+ }
145
+ }
146
+ }
147
+
148
+ }
149
 
150
  return $data;
151
  }
includes/class-follow-crawler.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- class-sns-follow-crawler.php
4
 
5
  Description: This class is a data crawler whitch get share count using given API and cURL
6
  Author: Daisuke Maruyama
@@ -39,9 +39,13 @@ class Follow_Crawler extends Data_Crawler {
39
  public function initialize( $options = array() ) {
40
  Common_Util::log( '[' . __METHOD__ . '] (line='. __LINE__ . ')' );
41
 
 
 
42
  if ( isset( $options['crawl_method'] ) ) $this->crawl_method = $options['crawl_method'];
43
  if ( isset( $options['timeout'] ) ) $this->timeout = $options['timeout'];
44
  if ( isset( $options['ssl_verification'] ) ) $this->ssl_verification = $options['ssl_verification'];
 
 
45
  }
46
 
47
  /**
@@ -60,12 +64,76 @@ class Follow_Crawler extends Data_Crawler {
60
 
61
  $data = array();
62
 
63
- if ( $this->crawl_method == SNS_Count_Cache::OPT_COMMON_CRAWLER_METHOD_CURL ) {
 
 
 
 
 
64
  $data = Common_Util::multi_remote_get( $query_urls, $this->timeout, $this->ssl_verification, true );
65
  } else {
66
  $data = Common_Util::multi_remote_get( $query_urls, $this->timeout, $this->ssl_verification, false );
67
  }
68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  return $this->extract_count( $target_sns, $data );
70
  }
71
 
1
  <?php
2
  /*
3
+ class-follow-crawler.php
4
 
5
  Description: This class is a data crawler whitch get share count using given API and cURL
6
  Author: Daisuke Maruyama
39
  public function initialize( $options = array() ) {
40
  Common_Util::log( '[' . __METHOD__ . '] (line='. __LINE__ . ')' );
41
 
42
+ //$this->throttle = new Sleep_Throttle( 0.9 );
43
+
44
  if ( isset( $options['crawl_method'] ) ) $this->crawl_method = $options['crawl_method'];
45
  if ( isset( $options['timeout'] ) ) $this->timeout = $options['timeout'];
46
  if ( isset( $options['ssl_verification'] ) ) $this->ssl_verification = $options['ssl_verification'];
47
+ if ( isset( $options['crawl_retry'] ) ) $this->crawl_retry = $options['crawl_retry'];
48
+ if ( isset( $options['retry_limit'] ) ) $this->retry_limit = $options['retry_limit'];
49
  }
50
 
51
  /**
64
 
65
  $data = array();
66
 
67
+ $throttle = new Sleep_Throttle( 0.9 );
68
+
69
+ $throttle->reset();
70
+ $throttle->start();
71
+
72
+ if ( $this->crawl_method === SNS_Count_Cache::OPT_COMMON_CRAWLER_METHOD_CURL ) {
73
  $data = Common_Util::multi_remote_get( $query_urls, $this->timeout, $this->ssl_verification, true );
74
  } else {
75
  $data = Common_Util::multi_remote_get( $query_urls, $this->timeout, $this->ssl_verification, false );
76
  }
77
 
78
+ $throttle->stop();
79
+
80
+ $retry_count = 0;
81
+
82
+ while( true ) {
83
+
84
+ $target_sns_retry = array();
85
+
86
+ $tmp_count = $this->extract_count( $target_sns, $data );
87
+
88
+ foreach ( $target_sns as $sns => $active ){
89
+ if ( $active ) {
90
+ if( $tmp_count[$sns] === -1 ) {
91
+ $target_sns_retry[$sns] = true;
92
+ }
93
+ }
94
+ }
95
+
96
+ if ( empty( $target_sns_retry ) ) {
97
+ break;
98
+
99
+ } else {
100
+
101
+ Common_Util::log( '[' . __METHOD__ . '] crawl failure' );
102
+ Common_Util::log( $target_sns_retry );
103
+
104
+ if ( $retry_count < $this->retry_limit ) {
105
+
106
+ Common_Util::log( '[' . __METHOD__ . '] sleep before crawl retry: ' . $throttle->get_sleep_time() . ' sec.' );
107
+
108
+ $throttle->sleep();
109
+
110
+ ++$retry_count;
111
+
112
+ Common_Util::log( '[' . __METHOD__ . '] count of crawl retry: ' . $retry_count );
113
+
114
+ $query_urls_retry = $this->build_query_urls( $target_sns_retry, $url );
115
+
116
+ $data_retry = array();
117
+
118
+ $throttle->reset();
119
+ $throttle->start();
120
+
121
+ if ( $this->crawl_method === SNS_Count_Cache::OPT_COMMON_CRAWLER_METHOD_CURL ) {
122
+ $data_retry = Common_Util::multi_remote_get( $query_urls_retry, $this->timeout, $this->ssl_verification, true );
123
+ } else {
124
+ $data_retry = Common_Util::multi_remote_get( $query_urls_retry, $this->timeout, $this->ssl_verification, false );
125
+ }
126
+
127
+ $throttle->stop();
128
+
129
+ $data = array_merge( $data, $data_retry );
130
+ } else {
131
+ Common_Util::log( '[' . __METHOD__ . '] crawling: retry failed' );
132
+ break;
133
+ }
134
+ }
135
+ }
136
+
137
  return $this->extract_count( $target_sns, $data );
138
  }
139
 
includes/class-follow-lazy-cache-engine.php CHANGED
@@ -66,7 +66,12 @@ class Follow_Lazy_Cache_Engine extends Follow_Cache_Engine {
66
  * Latency suffix
67
  */
68
  private $check_latency = 10;
69
-
 
 
 
 
 
70
  /**
71
  * Initialization
72
  *
@@ -81,6 +86,8 @@ class Follow_Lazy_Cache_Engine extends Follow_Cache_Engine {
81
  $this->event_schedule = self::DEF_EVENT_SCHEDULE;
82
  $this->event_description = self::DEF_EVENT_DESCRIPTION;
83
 
 
 
84
  if ( isset( $options['delegate'] ) ) $this->delegate = $options['delegate'];
85
  if ( isset( $options['crawler'] ) ) $this->crawler = $options['crawler'];
86
  if ( isset( $options['target_sns'] ) ) $this->target_sns = $options['target_sns'];
@@ -90,6 +97,9 @@ class Follow_Lazy_Cache_Engine extends Follow_Cache_Engine {
90
  if ( isset( $options['check_latency'] ) ) $this->check_latency = $options['check_latency'];
91
  if ( isset( $options['scheme_migration_mode'] ) ) $this->scheme_migration_mode = $options['scheme_migration_mode'];
92
  if ( isset( $options['scheme_migration_exclude_keys'] ) ) $this->scheme_migration_exclude_keys = $options['scheme_migration_exclude_keys'];
 
 
 
93
 
94
  add_action( $this->execute_cron, array( $this, 'execute_cache' ), 10, 0 );
95
 
@@ -133,7 +143,7 @@ class Follow_Lazy_Cache_Engine extends Follow_Cache_Engine {
133
 
134
  Common_Util::log( '[' . __METHOD__ . '] cache_expiration: ' . $cache_expiration );
135
 
136
- $url = get_feed_link();
137
 
138
  $transient_id = $this->get_cache_key( 'follow' );
139
 
66
  * Latency suffix
67
  */
68
  private $check_latency = 10;
69
+
70
+ /**
71
+ * Feed type
72
+ */
73
+ private $feed_type = '';
74
+
75
  /**
76
  * Initialization
77
  *
86
  $this->event_schedule = self::DEF_EVENT_SCHEDULE;
87
  $this->event_description = self::DEF_EVENT_DESCRIPTION;
88
 
89
+ $this->load_ratio = 0.5;
90
+
91
  if ( isset( $options['delegate'] ) ) $this->delegate = $options['delegate'];
92
  if ( isset( $options['crawler'] ) ) $this->crawler = $options['crawler'];
93
  if ( isset( $options['target_sns'] ) ) $this->target_sns = $options['target_sns'];
97
  if ( isset( $options['check_latency'] ) ) $this->check_latency = $options['check_latency'];
98
  if ( isset( $options['scheme_migration_mode'] ) ) $this->scheme_migration_mode = $options['scheme_migration_mode'];
99
  if ( isset( $options['scheme_migration_exclude_keys'] ) ) $this->scheme_migration_exclude_keys = $options['scheme_migration_exclude_keys'];
100
+ if ( isset( $options['feed_type'] ) ) $this->feed_type = $options['feed_type'];
101
+ if ( isset( $options['cache_retry'] ) ) $this->cache_retry = $options['cache_retry'];
102
+ if ( isset( $options['retry_limit'] ) ) $this->retry_limit = $options['retry_limit'];
103
 
104
  add_action( $this->execute_cron, array( $this, 'execute_cache' ), 10, 0 );
105
 
143
 
144
  Common_Util::log( '[' . __METHOD__ . '] cache_expiration: ' . $cache_expiration );
145
 
146
+ $url = get_feed_link( $this->feed_type );
147
 
148
  $transient_id = $this->get_cache_key( 'follow' );
149
 
includes/class-follow-second-cache-engine.php CHANGED
@@ -201,7 +201,7 @@ class Follow_Second_Cache_Engine extends Cache_Engine {
201
 
202
  foreach ( $this->target_sns as $sns => $active ) {
203
  if ( $active ) {
204
- $sns_followers[$sns] = -1;
205
  }
206
  }
207
 
201
 
202
  foreach ( $this->target_sns as $sns => $active ) {
203
  if ( $active ) {
204
+ $sns_followers[$sns] = (int) -1;
205
  }
206
  }
207
 
includes/class-share-analytical-engine.php CHANGED
@@ -86,8 +86,7 @@ class Share_Analytical_Engine extends Analytical_Engine {
86
  * Crawl date key
87
  */
88
  private $crawl_date_key = NULL;
89
-
90
-
91
  /**
92
  * Initialization
93
  *
@@ -116,7 +115,7 @@ class Share_Analytical_Engine extends Analytical_Engine {
116
  if ( isset( $options['execute_cron'] ) ) $this->execute_cron = $options['execute_cron'];
117
  if ( isset( $options['post_types'] ) ) $this->post_types = $options['post_types'];
118
  if ( isset( $options['crawl_date_key'] ) ) $this->crawl_date_key = $options['crawl_date_key'];
119
-
120
  add_action( $this->prime_cron, array( $this, 'prime_base' ) );
121
  add_action( $this->execute_cron, array( $this, 'execute_base' ), 10, 1 );
122
  add_filter( 'cron_schedules', array( $this, 'schedule_check_interval' ) );
@@ -167,8 +166,6 @@ class Share_Analytical_Engine extends Analytical_Engine {
167
 
168
  $current_date = date_i18n( 'Y/m/d H:i:s' );
169
 
170
- set_time_limit( $this->extended_max_execution_time );
171
-
172
  if( file_exists( $this->base_dir ) ) {
173
 
174
  $base_file = $this->base_dir . $this->get_base_key( 'home' );
@@ -313,7 +310,6 @@ class Share_Analytical_Engine extends Analytical_Engine {
313
  wp_reset_postdata();
314
  }
315
 
316
- set_time_limit( $this->original_max_execution_time );
317
  }
318
 
319
  /**
86
  * Crawl date key
87
  */
88
  private $crawl_date_key = NULL;
89
+
 
90
  /**
91
  * Initialization
92
  *
115
  if ( isset( $options['execute_cron'] ) ) $this->execute_cron = $options['execute_cron'];
116
  if ( isset( $options['post_types'] ) ) $this->post_types = $options['post_types'];
117
  if ( isset( $options['crawl_date_key'] ) ) $this->crawl_date_key = $options['crawl_date_key'];
118
+
119
  add_action( $this->prime_cron, array( $this, 'prime_base' ) );
120
  add_action( $this->execute_cron, array( $this, 'execute_base' ), 10, 1 );
121
  add_filter( 'cron_schedules', array( $this, 'schedule_check_interval' ) );
166
 
167
  $current_date = date_i18n( 'Y/m/d H:i:s' );
168
 
 
 
169
  if( file_exists( $this->base_dir ) ) {
170
 
171
  $base_file = $this->base_dir . $this->get_base_key( 'home' );
310
  wp_reset_postdata();
311
  }
312
 
 
313
  }
314
 
315
  /**
includes/class-share-base-cache-engine.php CHANGED
@@ -86,6 +86,8 @@ class Share_Base_Cache_Engine extends Share_Cache_Engine {
86
  $this->event_schedule = self::DEF_EVENT_SCHEDULE;
87
  $this->event_description = self::DEF_EVENT_DESCRIPTION;
88
 
 
 
89
  if ( isset( $options['delegate'] ) ) $this->delegate = $options['delegate'];
90
  if ( isset( $options['crawler'] ) ) $this->crawler = $options['crawler'];
91
  if ( isset( $options['target_sns'] ) ) $this->target_sns = $options['target_sns'];
@@ -100,6 +102,8 @@ class Share_Base_Cache_Engine extends Share_Cache_Engine {
100
  if ( isset( $options['scheme_migration_mode'] ) ) $this->scheme_migration_mode = $options['scheme_migration_mode'];
101
  if ( isset( $options['scheme_migration_date'] ) ) $this->scheme_migration_date = $options['scheme_migration_date'];
102
  if ( isset( $options['scheme_migration_exclude_keys'] ) ) $this->scheme_migration_exclude_keys = $options['scheme_migration_exclude_keys'];
 
 
103
 
104
  add_filter( 'cron_schedules', array( $this, 'schedule_check_interval' ) );
105
  add_action( $this->prime_cron, array( $this, 'prime_cache' ) );
@@ -147,7 +151,7 @@ class Share_Base_Cache_Engine extends Share_Cache_Engine {
147
 
148
  Common_Util::log( '[' . __METHOD__ . '] posts_offset: ' . $posts_offset );
149
 
150
- wp_schedule_single_event( $next_exec_time, $this->execute_cron, array( $posts_offset ) );
151
 
152
  $posts_offset = $posts_offset + $this->posts_per_check;
153
 
86
  $this->event_schedule = self::DEF_EVENT_SCHEDULE;
87
  $this->event_description = self::DEF_EVENT_DESCRIPTION;
88
 
89
+ $this->load_ratio = 0.5;
90
+
91
  if ( isset( $options['delegate'] ) ) $this->delegate = $options['delegate'];
92
  if ( isset( $options['crawler'] ) ) $this->crawler = $options['crawler'];
93
  if ( isset( $options['target_sns'] ) ) $this->target_sns = $options['target_sns'];
102
  if ( isset( $options['scheme_migration_mode'] ) ) $this->scheme_migration_mode = $options['scheme_migration_mode'];
103
  if ( isset( $options['scheme_migration_date'] ) ) $this->scheme_migration_date = $options['scheme_migration_date'];
104
  if ( isset( $options['scheme_migration_exclude_keys'] ) ) $this->scheme_migration_exclude_keys = $options['scheme_migration_exclude_keys'];
105
+ if ( isset( $options['cache_retry'] ) ) $this->cache_retry = $options['cache_retry'];
106
+ if ( isset( $options['retry_limit'] ) ) $this->retry_limit = $options['retry_limit'];
107
 
108
  add_filter( 'cron_schedules', array( $this, 'schedule_check_interval' ) );
109
  add_action( $this->prime_cron, array( $this, 'prime_cache' ) );
151
 
152
  Common_Util::log( '[' . __METHOD__ . '] posts_offset: ' . $posts_offset );
153
 
154
+ wp_schedule_single_event( $next_exec_time, $this->execute_cron, array( (int) $posts_offset ) );
155
 
156
  $posts_offset = $posts_offset + $this->posts_per_check;
157
 
includes/class-share-cache-engine.php CHANGED
@@ -60,7 +60,12 @@ abstract class Share_Cache_Engine extends Cache_Engine {
60
  * excluded keys in scheme migration
61
  */
62
  protected $scheme_migration_exclude_keys = array();
63
-
 
 
 
 
 
64
  /**
65
  * Get and cache data for a given post
66
  *
@@ -112,7 +117,6 @@ abstract class Share_Cache_Engine extends Cache_Engine {
112
  } else {
113
  if ( isset( $publish_date ) ) {
114
  if ( strtotime( $publish_date ) <= strtotime( $this->scheme_migration_date ) ) {
115
- Common_Util::log( '[' . __METHOD__ . '] oooooo: ' . $this->scheme_migration_date );
116
 
117
  $target_url = Common_Util::get_normal_url( $target_url );
118
 
@@ -159,38 +163,54 @@ abstract class Share_Cache_Engine extends Cache_Engine {
159
  }
160
 
161
  }
162
-
163
- /*
164
- if ( $this->scheme_migration_mode && Common_Util::is_secure_url( $target_url ) ) {
165
-
166
- $target_url = Common_Util::get_normal_url( $target_url );
167
 
168
- $target_sns_migrated = $target_sns;
169
-
170
- foreach ( $this->scheme_migration_exclude_keys as $sns ) {
171
- unset( $target_sns_migrated[$sns] );
172
- }
173
 
174
- Common_Util::log( '[' . __METHOD__ . '] target url: ' . $target_url );
175
 
176
- $migrated_data = $this->crawler->get_data( $target_sns_migrated, $target_url );
177
-
178
- Common_Util::log( $migrated_data );
179
-
180
- foreach ( $target_sns_migrated as $sns => $active ) {
181
- if ( $active && isset( $migrated_data[$sns] ) && is_numeric( $migrated_data[$sns] ) && $migrated_data[$sns] > 0 ){
182
- $data[$sns] = $data[$sns] + $migrated_data[$sns];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  }
184
  }
185
-
186
  }
187
- */
188
-
189
- if ( $data ) {
190
- $result = set_transient( $cache_key, $data, $cache_expiration );
191
-
192
- Common_Util::log( '[' . __METHOD__ . '] set_transient result: ' . $result );
193
- }
194
 
195
  Common_Util::log( '[' . __METHOD__ . '] current memory usage: ' . round( memory_get_usage( true )/1024/1024, 2 ) . ' MB' );
196
  Common_Util::log( '[' . __METHOD__ . '] max memory usage: ' . round( memory_get_peak_usage( true )/1024/1024, 2 ) . ' MB' );
@@ -200,6 +220,4 @@ abstract class Share_Cache_Engine extends Cache_Engine {
200
 
201
  }
202
 
203
-
204
-
205
  ?>
60
  * excluded keys in scheme migration
61
  */
62
  protected $scheme_migration_exclude_keys = array();
63
+
64
+ /**
65
+ * load ratio for throttle
66
+ */
67
+ protected $load_ratio = 0.5;
68
+
69
  /**
70
  * Get and cache data for a given post
71
  *
117
  } else {
118
  if ( isset( $publish_date ) ) {
119
  if ( strtotime( $publish_date ) <= strtotime( $this->scheme_migration_date ) ) {
 
120
 
121
  $target_url = Common_Util::get_normal_url( $target_url );
122
 
163
  }
164
 
165
  }
166
+
167
+ if ( $data ) {
168
+
169
+ $throttle = new Sleep_Throttle( $this->load_ratio );
 
170
 
171
+ $throttle->reset();
172
+ $throttle->start();
173
+
174
+ $result = set_transient( $cache_key, $data, $cache_expiration );
 
175
 
176
+ $throttle->stop();
177
 
178
+ $retry_count = 0;
179
+
180
+ while ( true ) {
181
+
182
+ Common_Util::log( '[' . __METHOD__ . '] set_transient result (' . $cache_key . '): ' . $result );
183
+
184
+ if ( $result ) {
185
+ break;
186
+
187
+ } else {
188
+
189
+ if ( $retry_count < $this->retry_limit ) {
190
+
191
+ Common_Util::log( '[' . __METHOD__ . '] sleep before set_transient retry (' . $cache_key . '): ' . $throttle->get_sleep_time() . ' sec.' );
192
+
193
+ $throttle->sleep();
194
+
195
+ ++$retry_count;
196
+
197
+ Common_Util::log( '[' . __METHOD__ . '] count of set_transient retry (' . $cache_key . '): ' . $retry_count );
198
+
199
+ $throttle->reset();
200
+ $throttle->start();
201
+
202
+ $result = set_transient( $cache_key, $data, $cache_expiration );
203
+
204
+ $throttle->stop();
205
+
206
+ } else {
207
+ Common_Util::log( '[' . __METHOD__ . '] set_transient result (' . $cache_key . '): retry failed' );
208
+ break;
209
+ }
210
  }
211
  }
212
+
213
  }
 
 
 
 
 
 
 
214
 
215
  Common_Util::log( '[' . __METHOD__ . '] current memory usage: ' . round( memory_get_usage( true )/1024/1024, 2 ) . ' MB' );
216
  Common_Util::log( '[' . __METHOD__ . '] max memory usage: ' . round( memory_get_peak_usage( true )/1024/1024, 2 ) . ' MB' );
220
 
221
  }
222
 
 
 
223
  ?>
includes/class-share-crawler.php CHANGED
@@ -39,9 +39,13 @@ class Share_Crawler extends Data_Crawler {
39
  public function initialize( $options = array() ) {
40
  Common_Util::log( '[' . __METHOD__ . '] (line='. __LINE__ . ')' );
41
 
 
 
42
  if ( isset( $options['crawl_method'] ) ) $this->crawl_method = $options['crawl_method'];
43
  if ( isset( $options['timeout'] ) ) $this->timeout = $options['timeout'];
44
  if ( isset( $options['ssl_verification'] ) ) $this->ssl_verification = $options['ssl_verification'];
 
 
45
  }
46
 
47
  /**
@@ -58,12 +62,77 @@ class Share_Crawler extends Data_Crawler {
58
 
59
  $data = array();
60
 
 
 
 
 
 
61
  if ( $this->crawl_method === SNS_Count_Cache::OPT_COMMON_CRAWLER_METHOD_CURL ) {
62
  $data = Common_Util::multi_remote_get( $query_urls, $this->timeout, $this->ssl_verification, true );
63
  } else {
64
  $data = Common_Util::multi_remote_get( $query_urls, $this->timeout, $this->ssl_verification, false );
65
  }
66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  return $this->extract_count( $target_sns, $data );
68
  }
69
 
39
  public function initialize( $options = array() ) {
40
  Common_Util::log( '[' . __METHOD__ . '] (line='. __LINE__ . ')' );
41
 
42
+ //$this->throttle = new Sleep_Throttle( 0.9 );
43
+
44
  if ( isset( $options['crawl_method'] ) ) $this->crawl_method = $options['crawl_method'];
45
  if ( isset( $options['timeout'] ) ) $this->timeout = $options['timeout'];
46
  if ( isset( $options['ssl_verification'] ) ) $this->ssl_verification = $options['ssl_verification'];
47
+ if ( isset( $options['crawl_retry'] ) ) $this->crawl_retry = $options['crawl_retry'];
48
+ if ( isset( $options['retry_limit'] ) ) $this->retry_limit = $options['retry_limit'];
49
  }
50
 
51
  /**
62
 
63
  $data = array();
64
 
65
+ $throttle = new Sleep_Throttle( 0.9 );
66
+
67
+ $throttle->reset();
68
+ $throttle->start();
69
+
70
  if ( $this->crawl_method === SNS_Count_Cache::OPT_COMMON_CRAWLER_METHOD_CURL ) {
71
  $data = Common_Util::multi_remote_get( $query_urls, $this->timeout, $this->ssl_verification, true );
72
  } else {
73
  $data = Common_Util::multi_remote_get( $query_urls, $this->timeout, $this->ssl_verification, false );
74
  }
75
 
76
+ $throttle->stop();
77
+
78
+ $retry_count = 0;
79
+
80
+ while( true ) {
81
+
82
+ $target_sns_retry = array();
83
+
84
+ $tmp_count = $this->extract_count( $target_sns, $data );
85
+
86
+ foreach ( $target_sns as $sns => $active ){
87
+ if ( $active ) {
88
+ if( $tmp_count[$sns] === -1 ) {
89
+ $target_sns_retry[$sns] = true;
90
+ }
91
+ }
92
+ }
93
+
94
+ if ( empty( $target_sns_retry ) ) {
95
+ break;
96
+
97
+ } else {
98
+
99
+ Common_Util::log( '[' . __METHOD__ . '] crawl failure' );
100
+ Common_Util::log( $target_sns_retry );
101
+
102
+ if ( $retry_count < $this->retry_limit ) {
103
+
104
+ Common_Util::log( '[' . __METHOD__ . '] sleep before crawl retry: ' . $throttle->get_sleep_time() . ' sec.' );
105
+
106
+ $throttle->sleep();
107
+
108
+ ++$retry_count;
109
+
110
+ Common_Util::log( '[' . __METHOD__ . '] count of crawl retry: ' . $retry_count );
111
+
112
+ $query_urls_retry = $this->build_query_urls( $target_sns_retry, $url );
113
+
114
+ $data_retry = array();
115
+
116
+ $throttle->reset();
117
+ $throttle->start();
118
+
119
+ if ( $this->crawl_method === SNS_Count_Cache::OPT_COMMON_CRAWLER_METHOD_CURL ) {
120
+ $data_retry = Common_Util::multi_remote_get( $query_urls_retry, $this->timeout, $this->ssl_verification, true );
121
+ } else {
122
+ $data_retry = Common_Util::multi_remote_get( $query_urls_retry, $this->timeout, $this->ssl_verification, false );
123
+ }
124
+
125
+ $throttle->stop();
126
+
127
+ $data = array_merge( $data, $data_retry );
128
+ } else {
129
+ Common_Util::log( '[' . __METHOD__ . '] crawling: retry failed' );
130
+ break;
131
+ }
132
+ }
133
+
134
+ }
135
+
136
  return $this->extract_count( $target_sns, $data );
137
  }
138
 
includes/class-share-lazy-cache-engine.php CHANGED
@@ -84,7 +84,9 @@ class Share_Lazy_Cache_Engine extends Share_Cache_Engine {
84
  $this->prime_cron = self::DEF_PRIME_CRON;
85
  $this->execute_cron = self::DEF_EXECUTE_CRON;
86
  $this->event_schedule = self::DEF_EVENT_SCHEDULE;
87
- $this->event_description = self::DEF_EVENT_DESCRIPTION;
 
 
88
 
89
  if ( isset( $options['delegate'] ) ) $this->delegate = $options['delegate'];
90
  if ( isset( $options['crawler'] ) ) $this->crawler = $options['crawler'];
@@ -98,6 +100,8 @@ class Share_Lazy_Cache_Engine extends Share_Cache_Engine {
98
  if ( isset( $options['scheme_migration_mode'] ) ) $this->scheme_migration_mode = $options['scheme_migration_mode'];
99
  if ( isset( $options['scheme_migration_date'] ) ) $this->scheme_migration_date = $options['scheme_migration_date'];
100
  if ( isset( $options['scheme_migration_exclude_keys'] ) ) $this->scheme_migration_exclude_keys = $options['scheme_migration_exclude_keys'];
 
 
101
 
102
  add_action( $this->execute_cron, array( $this, 'execute_cache' ), 10, 1 );
103
 
84
  $this->prime_cron = self::DEF_PRIME_CRON;
85
  $this->execute_cron = self::DEF_EXECUTE_CRON;
86
  $this->event_schedule = self::DEF_EVENT_SCHEDULE;
87
+ $this->event_description = self::DEF_EVENT_DESCRIPTION;
88
+
89
+ $this->load_ratio = 0.5;
90
 
91
  if ( isset( $options['delegate'] ) ) $this->delegate = $options['delegate'];
92
  if ( isset( $options['crawler'] ) ) $this->crawler = $options['crawler'];
100
  if ( isset( $options['scheme_migration_mode'] ) ) $this->scheme_migration_mode = $options['scheme_migration_mode'];
101
  if ( isset( $options['scheme_migration_date'] ) ) $this->scheme_migration_date = $options['scheme_migration_date'];
102
  if ( isset( $options['scheme_migration_exclude_keys'] ) ) $this->scheme_migration_exclude_keys = $options['scheme_migration_exclude_keys'];
103
+ if ( isset( $options['cache_retry'] ) ) $this->cache_retry = $options['cache_retry'];
104
+ if ( isset( $options['retry_limit'] ) ) $this->retry_limit = $options['retry_limit'];
105
 
106
  add_action( $this->execute_cron, array( $this, 'execute_cache' ), 10, 1 );
107
 
includes/class-share-rush-cache-engine.php CHANGED
@@ -90,6 +90,8 @@ class Share_Rush_Cache_Engine extends Share_Cache_Engine {
90
  $this->execute_cron = self::DEF_EXECUTE_CRON;
91
  $this->event_schedule = self::DEF_EVENT_SCHEDULE;
92
  $this->event_description = self::DEF_EVENT_DESCRIPTION;
 
 
93
 
94
  if ( isset( $options['delegate'] ) ) $this->delegate = $options['delegate'];
95
  if ( isset( $options['crawler'] ) ) $this->crawler = $options['crawler'];
@@ -106,6 +108,8 @@ class Share_Rush_Cache_Engine extends Share_Cache_Engine {
106
  if ( isset( $options['scheme_migration_mode'] ) ) $this->scheme_migration_mode = $options['scheme_migration_mode'];
107
  if ( isset( $options['scheme_migration_date'] ) ) $this->scheme_migration_date = $options['scheme_migration_date'];
108
  if ( isset( $options['scheme_migration_exclude_keys'] ) ) $this->scheme_migration_exclude_keys = $options['scheme_migration_exclude_keys'];
 
 
109
 
110
  add_filter( 'cron_schedules', array( $this, 'schedule_check_interval' ) );
111
  add_action( $this->prime_cron, array( $this, 'prime_cache' ) );
@@ -153,7 +157,7 @@ class Share_Rush_Cache_Engine extends Share_Cache_Engine {
153
 
154
  Common_Util::log( '[' . __METHOD__ . '] posts_offset: ' . $posts_offset );
155
 
156
- wp_schedule_single_event( $next_exec_time, $this->execute_cron, array( $posts_offset, Common_Util::short_hash( $next_exec_time ) ) );
157
 
158
  $posts_offset = $posts_offset + $this->posts_per_check;
159
 
@@ -323,4 +327,4 @@ class Share_Rush_Cache_Engine extends Share_Cache_Engine {
323
 
324
  }
325
 
326
- ?>
90
  $this->execute_cron = self::DEF_EXECUTE_CRON;
91
  $this->event_schedule = self::DEF_EVENT_SCHEDULE;
92
  $this->event_description = self::DEF_EVENT_DESCRIPTION;
93
+
94
+ $this->load_ratio = 0.5;
95
 
96
  if ( isset( $options['delegate'] ) ) $this->delegate = $options['delegate'];
97
  if ( isset( $options['crawler'] ) ) $this->crawler = $options['crawler'];
108
  if ( isset( $options['scheme_migration_mode'] ) ) $this->scheme_migration_mode = $options['scheme_migration_mode'];
109
  if ( isset( $options['scheme_migration_date'] ) ) $this->scheme_migration_date = $options['scheme_migration_date'];
110
  if ( isset( $options['scheme_migration_exclude_keys'] ) ) $this->scheme_migration_exclude_keys = $options['scheme_migration_exclude_keys'];
111
+ if ( isset( $options['cache_retry'] ) ) $this->cache_retry = $options['cache_retry'];
112
+ if ( isset( $options['retry_limit'] ) ) $this->retry_limit = $options['retry_limit'];
113
 
114
  add_filter( 'cron_schedules', array( $this, 'schedule_check_interval' ) );
115
  add_action( $this->prime_cron, array( $this, 'prime_cache' ) );
157
 
158
  Common_Util::log( '[' . __METHOD__ . '] posts_offset: ' . $posts_offset );
159
 
160
+ wp_schedule_single_event( $next_exec_time, $this->execute_cron, array( (int) $posts_offset, Common_Util::short_hash( $next_exec_time ) ) );
161
 
162
  $posts_offset = $posts_offset + $this->posts_per_check;
163
 
327
 
328
  }
329
 
330
+ ?>
includes/class-share-second-cache-engine.php CHANGED
@@ -312,7 +312,7 @@ class Share_Second_Cache_Engine extends Cache_Engine {
312
  $meta_key = $this->get_cache_key( $sns );
313
 
314
  if ( $active ) {
315
- update_post_meta( $post_id, $meta_key, -1 );
316
  }
317
  }
318
  }
312
  $meta_key = $this->get_cache_key( $sns );
313
 
314
  if ( $active ) {
315
+ update_post_meta( $post_id, $meta_key, (int) -1 );
316
  }
317
  }
318
  }
includes/class-sleep-throttle.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ class-sleep-throttle.php
4
+
5
+ Description: sleep utility
6
+ Author: Daisuke Maruyama
7
+ Author URI: http://marubon.info/
8
+ License: GPL2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.txt
10
+ */
11
+
12
+ /*
13
+
14
+ Copyright (C) 2014 - 2015 Daisuke Maruyama
15
+
16
+ This program is free software; you can redistribute it and/or
17
+ modify it under the terms of the GNU General Public License
18
+ as published by the Free Software Foundation; either version 2
19
+ of the License, or (at your option) any later version.
20
+
21
+ This program is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
+
26
+ You should have received a copy of the GNU General Public License
27
+ along with this program; if not, write to the Free Software
28
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29
+
30
+ */
31
+
32
+ final class Sleep_Throttle {
33
+
34
+ const SECOND_TO_MICRO_SECONDS = 1000000;
35
+
36
+ private $load_ratio = 0.9;
37
+
38
+ private $start_time = null;
39
+
40
+ private $stop_time = null;
41
+
42
+ private $sleep_time = null;
43
+
44
+ function __construct( $load_ratio ) {
45
+ $this->load_ratio = $load_ratio;
46
+ }
47
+
48
+ public function reset() {
49
+ $this->start_time = null;
50
+ $this->stop_time = null;
51
+ $this->sleep_time = null;
52
+ }
53
+
54
+ public function start() {
55
+ $this->start_time = gettimeofday( true );
56
+ }
57
+
58
+ public function stop() {
59
+ $this->stop_time = gettimeofday( true );
60
+
61
+ if ( ! is_null( $this->start_time ) && ! is_null( $this->stop_time ) ) {
62
+ $this->sleep_time = $this->calculate_sleep_time( $this->load_ratio, $this->stop_time - $this->start_time );
63
+ }
64
+ }
65
+
66
+ public function sleep() {
67
+ if ( ! is_null( $this->sleep_time) && $this->sleep_time > 0 ) {
68
+ usleep( $this->sleep_time * self::SECOND_TO_MICRO_SECONDS );
69
+ }
70
+ }
71
+
72
+ public function get_sleep_time() {
73
+ if ( ! is_null( $this->sleep_time) && $this->sleep_time > 0 ) {
74
+ return $this->sleep_time;
75
+ } else {
76
+ return 0;
77
+ }
78
+ }
79
+
80
+ private function calculate_sleep_time( $load_ratio, $time ) {
81
+ if ( $time > 0.0 ) {
82
+ return $time * ( 1 - $load_ratio ) / $load_ratio;
83
+ } else {
84
+ return 0;
85
+ }
86
+ }
87
+
88
+ }
89
+
90
+ ?>
languages/sns-count-cache-ja.mo ADDED
Binary file
languages/sns-count-cache-ja.po ADDED
@@ -0,0 +1,1097 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2015 SNS Count Cache
2
+ # This file is distributed under the same license as the SNS Count Cache package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: SNS Count Cache 0.8.0\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/sns-count-cache\n"
7
+ "POT-Creation-Date: 2015-08-23 10:44+0900\n"
8
+ "PO-Revision-Date: 2015-08-23 18:27+0900\n"
9
+ "Last-Translator: Daisuke Maruyama <marubon@gmail.com>\n"
10
+ "Language-Team: \n"
11
+ "Language: ja\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 1.8.4\n"
16
+ "Plural-Forms: nplurals=1; plural=0;\n"
17
+
18
+ #. Plugin Name of the plugin/theme
19
+ #: includes/admin-cache-status.php:73 includes/admin-dashboard.php:44
20
+ #: includes/admin-help.php:35 includes/admin-hot-content.php:70
21
+ #: includes/admin-setting.php:290 includes/admin-share-count.php:69
22
+ #: sns-count-cache.php:1222
23
+ msgid "SNS Count Cache"
24
+ msgstr ""
25
+
26
+ #: includes/admin-cache-status.php:76 includes/admin-dashboard.php:48
27
+ #: includes/admin-help.php:39 includes/admin-hot-content.php:73
28
+ #: includes/admin-setting.php:311 includes/admin-share-count.php:72
29
+ #: sns-count-cache.php:1223
30
+ msgid "Dashboard"
31
+ msgstr "ダッシュボード"
32
+
33
+ #: includes/admin-cache-status.php:77 includes/admin-cache-status.php:88
34
+ #: includes/admin-dashboard-widget.php:47 includes/admin-dashboard.php:49
35
+ #: includes/admin-dashboard.php:61 includes/admin-help.php:40
36
+ #: includes/admin-hot-content.php:74 includes/admin-setting.php:312
37
+ #: includes/admin-share-count.php:73 sns-count-cache.php:1224
38
+ msgid "Cache Status"
39
+ msgstr "キャッシュ状況"
40
+
41
+ #: includes/admin-cache-status.php:78 includes/admin-dashboard-widget.php:84
42
+ #: includes/admin-dashboard.php:50 includes/admin-dashboard.php:104
43
+ #: includes/admin-help.php:41 includes/admin-hot-content.php:75
44
+ #: includes/admin-setting.php:313 includes/admin-share-count.php:74
45
+ #: includes/admin-share-count.php:84 sns-count-cache.php:1225
46
+ msgid "Share Count"
47
+ msgstr "シェア数"
48
+
49
+ #: includes/admin-cache-status.php:80 includes/admin-dashboard.php:52
50
+ #: includes/admin-help.php:43 includes/admin-hot-content.php:76
51
+ #: includes/admin-hot-content.php:83 includes/admin-setting.php:315
52
+ #: includes/admin-share-count.php:76 sns-count-cache.php:1228
53
+ msgid "Hot Content"
54
+ msgstr "話題のコンテンツ"
55
+
56
+ #: includes/admin-cache-status.php:82 includes/admin-dashboard.php:54
57
+ #: includes/admin-help.php:45 includes/admin-hot-content.php:77
58
+ #: includes/admin-setting.php:317 includes/admin-share-count.php:78
59
+ #: sns-count-cache.php:1231
60
+ msgid "Setting"
61
+ msgstr "設定"
62
+
63
+ #: includes/admin-cache-status.php:83 includes/admin-dashboard.php:55
64
+ #: includes/admin-help.php:46 includes/admin-help.php:52
65
+ #: includes/admin-hot-content.php:78 includes/admin-setting.php:318
66
+ #: includes/admin-share-count.php:79 sns-count-cache.php:1232
67
+ msgid "Help"
68
+ msgstr "ヘルプ"
69
+
70
+ #: includes/admin-cache-status.php:94 includes/admin-hot-content.php:89
71
+ #: includes/admin-share-count.php:90
72
+ msgid "Content"
73
+ msgstr "コンテンツ"
74
+
75
+ #: includes/admin-cache-status.php:95 includes/admin-dashboard-widget.php:61
76
+ #: includes/admin-dashboard.php:76
77
+ msgid "Primary Cache"
78
+ msgstr "一次キャッシュ"
79
+
80
+ #: includes/admin-cache-status.php:96 includes/admin-dashboard-widget.php:71
81
+ #: includes/admin-dashboard.php:86
82
+ msgid "Secondary Cache"
83
+ msgstr "二次キャッシュ"
84
+
85
+ #: includes/admin-cache-status.php:97
86
+ msgid "Crawl Date"
87
+ msgstr "クロール日時"
88
+
89
+ #: includes/admin-cache-status.php:139 includes/admin-cache-status.php:179
90
+ #: includes/admin-cache-status.php:239 includes/admin-cache-status.php:272
91
+ msgid "full cache"
92
+ msgstr "完全キャッシュ"
93
+
94
+ #: includes/admin-cache-status.php:143 includes/admin-cache-status.php:183
95
+ #: includes/admin-cache-status.php:243 includes/admin-cache-status.php:276
96
+ msgid "partial cache"
97
+ msgstr "部分キャッシュ"
98
+
99
+ #: includes/admin-cache-status.php:147 includes/admin-cache-status.php:153
100
+ #: includes/admin-cache-status.php:187 includes/admin-cache-status.php:221
101
+ #: includes/admin-cache-status.php:247 includes/admin-cache-status.php:280
102
+ msgid "no cache"
103
+ msgstr "未キャッシュ"
104
+
105
+ #: includes/admin-cache-status.php:197 includes/admin-cache-status.php:299
106
+ msgid "no data"
107
+ msgstr "データなし"
108
+
109
+ #: includes/admin-cache-status.php:307
110
+ msgid "Cache"
111
+ msgstr "Cache"
112
+
113
+ #: includes/admin-dashboard-widget.php:51 includes/admin-dashboard.php:66
114
+ msgid "Cache Type"
115
+ msgstr "キャッシュタイプ"
116
+
117
+ #: includes/admin-dashboard-widget.php:52 includes/admin-dashboard.php:67
118
+ msgid "Cache Progress"
119
+ msgstr "キャッシュ進捗"
120
+
121
+ #: includes/admin-dashboard-widget.php:53 includes/admin-dashboard.php:68
122
+ msgid "Total Content"
123
+ msgstr "総コンテンツ数"
124
+
125
+ #: includes/admin-dashboard-widget.php:54 includes/admin-dashboard.php:69
126
+ msgid "State - Full Cache"
127
+ msgstr "状態 - 完全キャッシュ"
128
+
129
+ #: includes/admin-dashboard-widget.php:55 includes/admin-dashboard.php:70
130
+ msgid "State - Partial Cache"
131
+ msgstr "状態 - 部分キャッシュ"
132
+
133
+ #: includes/admin-dashboard-widget.php:56 includes/admin-dashboard.php:71
134
+ msgid "State - No Cache"
135
+ msgstr "状態 - 未キャッシュ"
136
+
137
+ #: includes/admin-dashboard-widget.php:99 includes/admin-dashboard.php:120
138
+ #: includes/admin-hot-content.php:108 includes/admin-setting.php:634
139
+ #: includes/admin-share-count.php:109
140
+ msgid "Twitter"
141
+ msgstr "Twitter"
142
+
143
+ #: includes/admin-dashboard-widget.php:102 includes/admin-dashboard.php:123
144
+ #: includes/admin-hot-content.php:111 includes/admin-setting.php:618
145
+ #: includes/admin-share-count.php:112
146
+ msgid "Facebook"
147
+ msgstr "Facebook"
148
+
149
+ #: includes/admin-dashboard-widget.php:105 includes/admin-dashboard.php:126
150
+ #: includes/admin-hot-content.php:114 includes/admin-setting.php:622
151
+ #: includes/admin-share-count.php:115
152
+ msgid "Google+"
153
+ msgstr "Google+"
154
+
155
+ #: includes/admin-dashboard-widget.php:108 includes/admin-dashboard.php:129
156
+ #: includes/admin-hot-content.php:117 includes/admin-setting.php:630
157
+ #: includes/admin-share-count.php:118
158
+ msgid "Pocket"
159
+ msgstr "Pocket"
160
+
161
+ #: includes/admin-dashboard-widget.php:111 includes/admin-dashboard.php:132
162
+ #: includes/admin-hot-content.php:120 includes/admin-share-count.php:121
163
+ msgid "Hatebu"
164
+ msgstr "はてブ"
165
+
166
+ #: includes/admin-dashboard-widget.php:114 includes/admin-dashboard.php:135
167
+ #: includes/admin-hot-content.php:123 includes/admin-share-count.php:124
168
+ msgid "Total"
169
+ msgstr "合計"
170
+
171
+ #: includes/admin-help.php:56
172
+ msgid "What is WordPress plugin SNS Cout Cache?"
173
+ msgstr "WordPressプラグイン SNS Count Cacheとは何か?"
174
+
175
+ #: includes/admin-help.php:57
176
+ msgid ""
177
+ "WordPress plugin SNS Count Cache is a plugin whitch helps you to shorten page "
178
+ "loading time when you display share counts. This plugin gets share count for "
179
+ "Twitter and Facebook, Google Plus, Pocket, Hatena Bookmark and caches these "
180
+ "count in the background. The share count can be retrieved not through network "
181
+ "but through the cache using given functions."
182
+ msgstr ""
183
+ "WordPressプラグイン SNS Count Cacheは、シェア数を表示している場合にページの表示"
184
+ "時間を高速化するプラグインです。このプラグインは、Twitter、Facebook、Google+、"
185
+ "Pocket、はてなブックマークのシェア数をバックグラウンドで取得し、キャッシュしま"
186
+ "す。これらのシェア数は、指定された関数を用いることでネットワーク経由ではなく、"
187
+ "キャッシュから参照可能になります。"
188
+
189
+ #: includes/admin-help.php:58
190
+ msgid "How often does this plugin get and cache share counts?"
191
+ msgstr "SNSカウントを取得、キャッシュする頻度は?"
192
+
193
+ #: includes/admin-help.php:59
194
+ msgid ""
195
+ "Although this plugin gets share count of 20 posts at a time every 10 minutes "
196
+ "by default, you can modify the setting in the \"Setting\" tab in the "
197
+ "administration page."
198
+ msgstr ""
199
+ "デフォルトで10分ごとに20記事の取得するが、管理ページの「設定」タブにて変更する"
200
+ "ことが可能です。"
201
+
202
+ #: includes/admin-help.php:60
203
+ msgid "How can I know whether share count of each post is cached or not?"
204
+ msgstr "各記事のSNSカウントのキャッシュ有無を確認する方法は?"
205
+
206
+ #: includes/admin-help.php:61
207
+ msgid ""
208
+ "Cache status is described in the \"Cache Status\" tab in the administration "
209
+ "page."
210
+ msgstr "キャッシュ状態は、管理ページの「キャッシュ状況」タブにて確認可能です。"
211
+
212
+ #: includes/admin-help.php:62
213
+ msgid "How can I get share count from the cache?"
214
+ msgstr "キャッシュからSNSカウントを参照する方法は?"
215
+
216
+ #: includes/admin-help.php:63
217
+ msgid ""
218
+ "The share count is retrieved from the cache using the following functions in "
219
+ "the WordPress loop such as query_posts(), get_posts() and WP_Query()."
220
+ msgstr ""
221
+ "WordPressのquery_posts()、get_posts()、WP_Query()等のループ内で下記の関数を使う"
222
+ "ことでキャッシュからSNSカウントを参照できます。"
223
+
224
+ #: includes/admin-help.php:67 includes/admin-help.php:85
225
+ msgid "Function"
226
+ msgstr "関数"
227
+
228
+ #: includes/admin-help.php:68 includes/admin-help.php:86
229
+ #: includes/admin-help.php:142 includes/admin-help.php:160
230
+ msgid "Description"
231
+ msgstr "説明"
232
+
233
+ #: includes/admin-help.php:72
234
+ msgid "Twitter share count is returned from cache."
235
+ msgstr "キャッシュからTwitterのSNSカウントが返されます。"
236
+
237
+ #: includes/admin-help.php:73
238
+ msgid "Facebook share count is returned from cache."
239
+ msgstr "キャッシュからFacebookのSNSカウントが返されます。"
240
+
241
+ #: includes/admin-help.php:74
242
+ msgid "Google Plus share count is returned from cache."
243
+ msgstr "キャッシュからGoogle+のSNSカウントが返されます。"
244
+
245
+ #: includes/admin-help.php:75
246
+ msgid "Hatena Bookmark share count is returned from cache."
247
+ msgstr "キャッシュからはてなブックマークのSNSカウントが返されます。"
248
+
249
+ #: includes/admin-help.php:76
250
+ msgid "Pocket share count is returned from cache."
251
+ msgstr "キャッシュからPocketのSNSカウントが返されます。"
252
+
253
+ #: includes/admin-help.php:77
254
+ msgid "Total share count of selected SNS is returned from cache."
255
+ msgstr "キャッシュから対象として設定されたSNSのカウントの総和が返されます。"
256
+
257
+ #: includes/admin-help.php:80
258
+ msgid "How can I get follow count from the cache?"
259
+ msgstr "キャッシュからフォロー数を参照する方法は?"
260
+
261
+ #: includes/admin-help.php:81
262
+ msgid ""
263
+ "The follow count is retrieved from the cache using the following functions."
264
+ msgstr "フォロー数は、以下の関数を用いることでキャッシュから参照可能です。"
265
+
266
+ #: includes/admin-help.php:90
267
+ msgid "Feedly follow count is returned from cache."
268
+ msgstr "キャッシュからFeedlyのフォロー数が返されます。"
269
+
270
+ #: includes/admin-help.php:93
271
+ msgid "Example Code"
272
+ msgstr "サンプルコード"
273
+
274
+ #: includes/admin-help.php:94
275
+ msgid ""
276
+ "The code below describes a simple example which displays share count and "
277
+ "follower count using the above functions for each post."
278
+ msgstr ""
279
+ "以下のコードは、上述した関数を用いて記事ごとにシェア数やフォロー数を表示する簡"
280
+ "単な例です。"
281
+
282
+ #: includes/admin-help.php:136
283
+ msgid "How can I access specific custom field containing each share count?"
284
+ msgstr "シェア数を含むカスタムフィールドにアクセスする方法は?"
285
+
286
+ #: includes/admin-help.php:137
287
+ msgid ""
288
+ "Custom fields including share count are accessed using the following meta keys."
289
+ msgstr "シェア数を含むカスタムフィールドは、以下のmeta keyを用いて参照可能です。"
290
+
291
+ #: includes/admin-help.php:141 includes/admin-help.php:159
292
+ msgid "Meta Key"
293
+ msgstr "Meta Key"
294
+
295
+ #: includes/admin-help.php:146
296
+ msgid "A meta key for Twitter share count"
297
+ msgstr "Twitterのシェア数のためのMeta Keyです。"
298
+
299
+ #: includes/admin-help.php:147
300
+ msgid "A meta key for Facebook share count"
301
+ msgstr "Facebookのシェア数のためのMeta Keyです。"
302
+
303
+ #: includes/admin-help.php:148
304
+ msgid "A meta key for Google Plus share count"
305
+ msgstr "Google+のシェア数のためのMeta Keyです。"
306
+
307
+ #: includes/admin-help.php:149
308
+ msgid "A meta key for Hatena Bookmark share count"
309
+ msgstr "はてなブックマークのシェア数のためのMeta Keyです。"
310
+
311
+ #: includes/admin-help.php:150
312
+ msgid "A meta key for Pocket share count"
313
+ msgstr "Pocketのシェア数のためのMeta Keyです。"
314
+
315
+ #: includes/admin-help.php:151
316
+ msgid "A meta key for total share count"
317
+ msgstr "シェア数の合計のためのMeta Keyです。"
318
+
319
+ #: includes/admin-help.php:154
320
+ msgid ""
321
+ "How can I access specific custom field containing each variation of share "
322
+ "count?"
323
+ msgstr "シェア数の増減を含むカスタムフィールドにアクセスする方法は?"
324
+
325
+ #: includes/admin-help.php:155
326
+ msgid ""
327
+ "Custom fields including variation of share count are accessed using the "
328
+ "following meta keys."
329
+ msgstr ""
330
+ "シェア数の増減を含むカスタムフィールドは、以下のmeta keyを用いて参照可能です。"
331
+
332
+ #: includes/admin-help.php:164
333
+ msgid "A meta key for variation of Twitter share count"
334
+ msgstr "Twitterのシェア数増減のためのMeta Keyです。"
335
+
336
+ #: includes/admin-help.php:165
337
+ msgid "A meta key for variation of Facebook share count"
338
+ msgstr "Facebookのシェア数増減のためのMeta Keyです。"
339
+
340
+ #: includes/admin-help.php:166
341
+ msgid "A meta key for variation of Google Plus share count"
342
+ msgstr "Google+のシェア数増減のためのMeta Keyです。"
343
+
344
+ #: includes/admin-help.php:167
345
+ msgid "A meta key for variation of Hatena Bookmark share count"
346
+ msgstr "はてなブックマークのシェア数増減のためのMeta Keyです。"
347
+
348
+ #: includes/admin-help.php:168
349
+ msgid "A meta key for variation of Pocket share count"
350
+ msgstr "Pocketのシェア数増減のためのMeta Keyです。"
351
+
352
+ #: includes/admin-help.php:169
353
+ msgid "A meta key for variation of total share count"
354
+ msgstr "シェア数増減の合計のためのMeta Keyです。"
355
+
356
+ #: includes/admin-hot-content.php:281 includes/admin-hot-content.php:313
357
+ #: includes/admin-hot-content.php:334 includes/admin-setting.php:377
358
+ #: includes/admin-setting.php:414 includes/admin-share-count.php:201
359
+ #: includes/admin-share-count.php:217 includes/admin-share-count.php:249
360
+ #: includes/admin-share-count.php:264 includes/admin-share-count.php:274
361
+ #: includes/admin-share-count.php:305 includes/admin-share-count.php:321
362
+ #: includes/admin-share-count.php:354 includes/admin-share-count.php:369
363
+ #: includes/admin-share-count.php:379 includes/admin-share-count.php:427
364
+ #: includes/admin-share-count.php:462
365
+ msgid "N/A"
366
+ msgstr "N/A"
367
+
368
+ #: includes/admin-hot-content.php:330
369
+ msgid "No hot content."
370
+ msgstr "話題のコンテンツはありません。"
371
+
372
+ #: includes/admin-setting.php:35 includes/admin-setting.php:688
373
+ #: includes/admin-setting.php:732 includes/admin-setting.php:987
374
+ #: includes/admin-setting.php:1015 includes/admin-setting.php:1045
375
+ #: includes/admin-setting.php:1069 includes/admin-setting.php:1105
376
+ #: includes/admin-setting.php:1374
377
+ msgid "Update All Options"
378
+ msgstr "設定の更新"
379
+
380
+ #: includes/admin-setting.php:225 includes/admin-setting.php:1429
381
+ msgid "Reset"
382
+ msgstr "リセット"
383
+
384
+ #: includes/admin-setting.php:233 includes/admin-setting.php:1411
385
+ msgid "Export"
386
+ msgstr "エクスポート"
387
+
388
+ #: includes/admin-setting.php:245 includes/admin-setting.php:988
389
+ msgid "Update Basis of Comparison"
390
+ msgstr "比較基準の更新"
391
+
392
+ #: includes/admin-setting.php:257 includes/admin-setting.php:272
393
+ #: includes/admin-setting.php:689 includes/admin-setting.php:1016
394
+ msgid "Clear Cache"
395
+ msgstr "キャッシュの消去"
396
+
397
+ #: includes/admin-setting.php:321 includes/admin-setting.php:326
398
+ msgid "Current Setting"
399
+ msgstr "現在の設定"
400
+
401
+ #: includes/admin-setting.php:321 includes/admin-setting.php:338
402
+ #: includes/admin-setting.php:371 includes/admin-setting.php:383
403
+ #: includes/admin-setting.php:388 includes/admin-setting.php:393
404
+ #: includes/admin-setting.php:407 includes/admin-setting.php:610
405
+ msgid "Share Base Cache"
406
+ msgstr "シェア基本キャッシュ機能"
407
+
408
+ #: includes/admin-setting.php:321 includes/admin-setting.php:421
409
+ #: includes/admin-setting.php:434 includes/admin-setting.php:695
410
+ msgid "Share Rush Cache"
411
+ msgstr "シェア臨時キャッシュ機能"
412
+
413
+ #: includes/admin-setting.php:321 includes/admin-setting.php:444
414
+ #: includes/admin-setting.php:465 includes/admin-setting.php:738
415
+ msgid "Share Variation Analysis"
416
+ msgstr "シェア変動分析機能"
417
+
418
+ #: includes/admin-setting.php:321 includes/admin-setting.php:473
419
+ #: includes/admin-setting.php:486 includes/admin-setting.php:994
420
+ msgid "Follow Base Cache"
421
+ msgstr "フォロー基本キャッシュ機能"
422
+
423
+ #: includes/admin-setting.php:321 includes/admin-setting.php:525
424
+ #: includes/admin-setting.php:1052
425
+ msgid "Dynamic Cache"
426
+ msgstr "動的キャッシュ機能"
427
+
428
+ #: includes/admin-setting.php:321 includes/admin-setting.php:546
429
+ #: includes/admin-setting.php:562 includes/admin-setting.php:1075
430
+ msgid "Data Crawler"
431
+ msgstr "データクローラ機能"
432
+
433
+ #: includes/admin-setting.php:321 includes/admin-setting.php:575
434
+ #: includes/admin-setting.php:593 includes/admin-setting.php:1111
435
+ msgid "Data Export"
436
+ msgstr "データエクスポート機能"
437
+
438
+ #: includes/admin-setting.php:321 includes/admin-setting.php:1383
439
+ msgid "Exported File"
440
+ msgstr "エクスポートされたファイル"
441
+
442
+ #: includes/admin-setting.php:331
443
+ msgid "Capability"
444
+ msgstr "機能"
445
+
446
+ #: includes/admin-setting.php:332
447
+ msgid "Parameter"
448
+ msgstr "パラメータ"
449
+
450
+ #: includes/admin-setting.php:333
451
+ msgid "Value"
452
+ msgstr "値"
453
+
454
+ #: includes/admin-setting.php:339 includes/admin-setting.php:474
455
+ #: includes/admin-setting.php:614 includes/admin-setting.php:998
456
+ msgid "Target SNS"
457
+ msgstr "対象SNS"
458
+
459
+ #: includes/admin-setting.php:350 includes/admin-setting.php:626
460
+ msgid "Hatena Bookmark"
461
+ msgstr "はてなブックマーク"
462
+
463
+ #: includes/admin-setting.php:372 includes/admin-setting.php:639
464
+ msgid "Custom post types"
465
+ msgstr "カスタム投稿タイプ"
466
+
467
+ #: includes/admin-setting.php:384 includes/admin-setting.php:435
468
+ #: includes/admin-setting.php:647 includes/admin-setting.php:722
469
+ msgid "Interval cheking share count (sec)"
470
+ msgstr "シェア数のチェック間隔(秒)"
471
+
472
+ #: includes/admin-setting.php:385 includes/admin-setting.php:438
473
+ #: includes/admin-setting.php:488 includes/admin-setting.php:725
474
+ msgid "seconds"
475
+ msgstr "秒"
476
+
477
+ #: includes/admin-setting.php:389 includes/admin-setting.php:654
478
+ msgid "Number of contents to check at a time"
479
+ msgstr "一度にチェックするコンテンツ数"
480
+
481
+ #: includes/admin-setting.php:390
482
+ msgid "contents"
483
+ msgstr "コンテンツ"
484
+
485
+ #: includes/admin-setting.php:394 includes/admin-setting.php:661
486
+ msgid "Scheme migration mode from http to https"
487
+ msgstr "HTTPからHTTPSへのスキーム移行モード"
488
+
489
+ #: includes/admin-setting.php:398 includes/admin-setting.php:567
490
+ #: includes/admin-setting.php:665 includes/admin-setting.php:1098
491
+ msgid "On"
492
+ msgstr "有効"
493
+
494
+ #: includes/admin-setting.php:400 includes/admin-setting.php:569
495
+ #: includes/admin-setting.php:664 includes/admin-setting.php:1097
496
+ msgid "Off"
497
+ msgstr "無効"
498
+
499
+ #: includes/admin-setting.php:408 includes/admin-setting.php:672
500
+ msgid "Scheme migration date from http to https"
501
+ msgstr "HTTPからHTTPSへのスキーム移行日"
502
+
503
+ #: includes/admin-setting.php:422 includes/admin-setting.php:699
504
+ msgid "Term considering posted content as new content"
505
+ msgstr "投稿日からコンテンツを新着とみなす期間"
506
+
507
+ #: includes/admin-setting.php:426
508
+ msgid "day"
509
+ msgstr "日"
510
+
511
+ #: includes/admin-setting.php:428
512
+ msgid "days"
513
+ msgstr "日"
514
+
515
+ #: includes/admin-setting.php:445 includes/admin-setting.php:742
516
+ msgid "Method to update basis of comparison"
517
+ msgstr "比較基準の更新方式"
518
+
519
+ #: includes/admin-setting.php:449 includes/admin-setting.php:530
520
+ #: includes/admin-setting.php:745 includes/admin-setting.php:1059
521
+ msgid "Disabled (None)"
522
+ msgstr "無効(なし)"
523
+
524
+ #: includes/admin-setting.php:452 includes/admin-setting.php:746
525
+ msgid "Enabled (Manual)"
526
+ msgstr "有効(手動)"
527
+
528
+ #: includes/admin-setting.php:455 includes/admin-setting.php:747
529
+ msgid "Enabled (Scheduler)"
530
+ msgstr "有効(スケジューラ)"
531
+
532
+ #: includes/admin-setting.php:466
533
+ msgid "Schedule"
534
+ msgstr "スケジュール"
535
+
536
+ #: includes/admin-setting.php:487 includes/admin-setting.php:1007
537
+ msgid "Interval cheking follower count (sec)"
538
+ msgstr "フォロー数のチェック間隔(秒)"
539
+
540
+ #: includes/admin-setting.php:492 includes/admin-setting.php:519
541
+ #: includes/admin-setting.php:1023
542
+ msgid "Follow Base Cache - Feedly"
543
+ msgstr "フォロー基本キャッシュ機能 - Feedly"
544
+
545
+ #: includes/admin-setting.php:493 includes/admin-setting.php:1027
546
+ msgid "Target feed type"
547
+ msgstr "対象フィードタイプ"
548
+
549
+ #: includes/admin-setting.php:498 includes/admin-setting.php:513
550
+ #: includes/admin-setting.php:1030
551
+ msgid "Default"
552
+ msgstr "デフォルト"
553
+
554
+ #: includes/admin-setting.php:501 includes/admin-setting.php:1031
555
+ msgid "RSS"
556
+ msgstr "RSS"
557
+
558
+ #: includes/admin-setting.php:504 includes/admin-setting.php:1032
559
+ msgid "RSS2"
560
+ msgstr "RSS2"
561
+
562
+ #: includes/admin-setting.php:507 includes/admin-setting.php:1033
563
+ msgid "RDF"
564
+ msgstr "RDF"
565
+
566
+ #: includes/admin-setting.php:510 includes/admin-setting.php:1034
567
+ msgid "ATOM"
568
+ msgstr "ATOM"
569
+
570
+ #: includes/admin-setting.php:520 includes/admin-setting.php:1040
571
+ msgid "Target feed"
572
+ msgstr "対象フィード"
573
+
574
+ #: includes/admin-setting.php:526 includes/admin-setting.php:1056
575
+ msgid "Dynamic caching based on user access"
576
+ msgstr "ユーザアクセスをトリガとする動的キャッシュ"
577
+
578
+ #: includes/admin-setting.php:533 includes/admin-setting.php:1060
579
+ msgid "Enabled (Synchronous Cache)"
580
+ msgstr "有効(同期キャッシュ)"
581
+
582
+ #: includes/admin-setting.php:536 includes/admin-setting.php:1061
583
+ msgid "Enabled (Asynchronous Cache)"
584
+ msgstr "有効(非同期キャッシュ)"
585
+
586
+ #: includes/admin-setting.php:539 includes/admin-setting.php:1062
587
+ msgid "Enabled (Asynchronous 2nd Cache)"
588
+ msgstr "有効(非同期2次キャッシュ)"
589
+
590
+ #: includes/admin-setting.php:547 includes/admin-setting.php:1079
591
+ msgid "Crawl method"
592
+ msgstr "クロールの方式"
593
+
594
+ #: includes/admin-setting.php:552 includes/admin-setting.php:1084
595
+ msgid "Normal (Sequential Retrieval)"
596
+ msgstr "標準(逐次検索)"
597
+
598
+ #: includes/admin-setting.php:555 includes/admin-setting.php:1087
599
+ msgid "Extended (Parallel Retrieval)"
600
+ msgstr "拡張(並列検索)"
601
+
602
+ #: includes/admin-setting.php:563 includes/admin-setting.php:1094
603
+ msgid "SSL verification"
604
+ msgstr "SSL証明書の検証"
605
+
606
+ #: includes/admin-setting.php:576 includes/admin-setting.php:1115
607
+ msgid "Method of data export"
608
+ msgstr "データのエクスポート方式"
609
+
610
+ #: includes/admin-setting.php:580 includes/admin-setting.php:1118
611
+ msgid "Manual"
612
+ msgstr "手動"
613
+
614
+ #: includes/admin-setting.php:583 includes/admin-setting.php:784
615
+ #: includes/admin-setting.php:1119 includes/admin-setting.php:1155
616
+ msgid "Scheduler"
617
+ msgstr "有効(スケジューラ)"
618
+
619
+ #: includes/admin-setting.php:594
620
+ msgid "Interval exporting share count to a csv file"
621
+ msgstr "シェア数をCSVファイルにエクスポートする間隔"
622
+
623
+ #: includes/admin-setting.php:595
624
+ msgid "hours"
625
+ msgstr "時間"
626
+
627
+ #: includes/admin-setting.php:643
628
+ msgid "e.g. aaa, bbb, ccc (comma-delimited)"
629
+ msgstr "例. aaa, bbb, ccc(カンマ区切り)"
630
+
631
+ #: includes/admin-setting.php:650
632
+ msgid "Default: 600"
633
+ msgstr "既定値: 600"
634
+
635
+ #: includes/admin-setting.php:657
636
+ msgid "Default: 20"
637
+ msgstr "既定値: 20"
638
+
639
+ #: includes/admin-setting.php:667
640
+ msgid "Default: Off"
641
+ msgstr "既定値: 無効"
642
+
643
+ #: includes/admin-setting.php:675
644
+ msgid "Default: N/A"
645
+ msgstr "既定値: N/A"
646
+
647
+ #: includes/admin-setting.php:702
648
+ msgid "1 day"
649
+ msgstr "1日"
650
+
651
+ #: includes/admin-setting.php:703
652
+ msgid "2 days"
653
+ msgstr "2日"
654
+
655
+ #: includes/admin-setting.php:704
656
+ msgid "3 days"
657
+ msgstr "3日"
658
+
659
+ #: includes/admin-setting.php:705
660
+ msgid "4 days"
661
+ msgstr "4日"
662
+
663
+ #: includes/admin-setting.php:706
664
+ msgid "5 days"
665
+ msgstr "5日"
666
+
667
+ #: includes/admin-setting.php:707
668
+ msgid "6 days"
669
+ msgstr "6日"
670
+
671
+ #: includes/admin-setting.php:708
672
+ msgid "7 days"
673
+ msgstr "7日"
674
+
675
+ #: includes/admin-setting.php:709
676
+ msgid "8 days"
677
+ msgstr "8日"
678
+
679
+ #: includes/admin-setting.php:710
680
+ msgid "9 days"
681
+ msgstr "9日"
682
+
683
+ #: includes/admin-setting.php:711
684
+ msgid "10 days"
685
+ msgstr "10日"
686
+
687
+ #: includes/admin-setting.php:712
688
+ msgid "11 days"
689
+ msgstr "11日"
690
+
691
+ #: includes/admin-setting.php:713
692
+ msgid "12 days"
693
+ msgstr "12日"
694
+
695
+ #: includes/admin-setting.php:714
696
+ msgid "13 days"
697
+ msgstr "13日"
698
+
699
+ #: includes/admin-setting.php:715
700
+ msgid "14 days"
701
+ msgstr "14日"
702
+
703
+ #: includes/admin-setting.php:717
704
+ msgid "Default: 3 days"
705
+ msgstr "既定値: 3日"
706
+
707
+ #: includes/admin-setting.php:749
708
+ msgid "Default: None"
709
+ msgstr "既定値: なし"
710
+
711
+ #: includes/admin-setting.php:789 includes/admin-setting.php:1160
712
+ msgid "Type"
713
+ msgstr "タイプ"
714
+
715
+ #: includes/admin-setting.php:794 includes/admin-setting.php:1165
716
+ msgid "Hour"
717
+ msgstr "時"
718
+
719
+ #: includes/admin-setting.php:797 includes/admin-setting.php:1168
720
+ msgid "Minute"
721
+ msgstr "分"
722
+
723
+ #: includes/admin-setting.php:803 includes/admin-setting.php:1174
724
+ msgid "monthly"
725
+ msgstr "毎月"
726
+
727
+ #: includes/admin-setting.php:812 includes/admin-setting.php:1183
728
+ msgid "on 1."
729
+ msgstr "1日"
730
+
731
+ #: includes/admin-setting.php:815 includes/admin-setting.php:1186
732
+ msgid "on 2."
733
+ msgstr "2日"
734
+
735
+ #: includes/admin-setting.php:818 includes/admin-setting.php:1189
736
+ msgid "on 3."
737
+ msgstr "3日"
738
+
739
+ #: includes/admin-setting.php:821 includes/admin-setting.php:1192
740
+ msgid "on 4."
741
+ msgstr "4日"
742
+
743
+ #: includes/admin-setting.php:824 includes/admin-setting.php:1195
744
+ msgid "on 5."
745
+ msgstr "5日"
746
+
747
+ #: includes/admin-setting.php:827 includes/admin-setting.php:1198
748
+ msgid "on 6."
749
+ msgstr "6日"
750
+
751
+ #: includes/admin-setting.php:830 includes/admin-setting.php:1201
752
+ msgid "on 7."
753
+ msgstr "7日"
754
+
755
+ #: includes/admin-setting.php:833 includes/admin-setting.php:1204
756
+ msgid "on 8."
757
+ msgstr "8日"
758
+
759
+ #: includes/admin-setting.php:836 includes/admin-setting.php:1207
760
+ msgid "on 9."
761
+ msgstr "9日"
762
+
763
+ #: includes/admin-setting.php:839 includes/admin-setting.php:1210
764
+ msgid "on 10."
765
+ msgstr "10日"
766
+
767
+ #: includes/admin-setting.php:842 includes/admin-setting.php:1213
768
+ msgid "on 11."
769
+ msgstr "11日"
770
+
771
+ #: includes/admin-setting.php:845 includes/admin-setting.php:1216
772
+ msgid "on 12."
773
+ msgstr "12日"
774
+
775
+ #: includes/admin-setting.php:848 includes/admin-setting.php:1219
776
+ msgid "on 13."
777
+ msgstr "13日"
778
+
779
+ #: includes/admin-setting.php:851 includes/admin-setting.php:1222
780
+ msgid "on 14."
781
+ msgstr "14日"
782
+
783
+ #: includes/admin-setting.php:854 includes/admin-setting.php:1225
784
+ msgid "on 15."
785
+ msgstr "15日"
786
+
787
+ #: includes/admin-setting.php:857 includes/admin-setting.php:1228
788
+ msgid "on 16."
789
+ msgstr "16日"
790
+
791
+ #: includes/admin-setting.php:860 includes/admin-setting.php:1231
792
+ msgid "on 17."
793
+ msgstr "17日"
794
+
795
+ #: includes/admin-setting.php:863 includes/admin-setting.php:1234
796
+ msgid "on 18."
797
+ msgstr "18日"
798
+
799
+ #: includes/admin-setting.php:866 includes/admin-setting.php:1237
800
+ msgid "on 19."
801
+ msgstr "19日"
802
+
803
+ #: includes/admin-setting.php:869 includes/admin-setting.php:1240
804
+ msgid "on 20."
805
+ msgstr "20日"
806
+
807
+ #: includes/admin-setting.php:872 includes/admin-setting.php:1243
808
+ msgid "on 21."
809
+ msgstr "21日"
810
+
811
+ #: includes/admin-setting.php:875 includes/admin-setting.php:1246
812
+ msgid "on 22."
813
+ msgstr "22日"
814
+
815
+ #: includes/admin-setting.php:878 includes/admin-setting.php:1249
816
+ msgid "on 23."
817
+ msgstr "23日"
818
+
819
+ #: includes/admin-setting.php:881 includes/admin-setting.php:1252
820
+ msgid "on 24."
821
+ msgstr "24日"
822
+
823
+ #: includes/admin-setting.php:884 includes/admin-setting.php:1255
824
+ msgid "on 25."
825
+ msgstr "25日"
826
+
827
+ #: includes/admin-setting.php:887 includes/admin-setting.php:1258
828
+ msgid "on 26."
829
+ msgstr "26日"
830
+
831
+ #: includes/admin-setting.php:890 includes/admin-setting.php:1261
832
+ msgid "on 27."
833
+ msgstr "27日"
834
+
835
+ #: includes/admin-setting.php:893 includes/admin-setting.php:1264
836
+ msgid "on 28."
837
+ msgstr "28日"
838
+
839
+ #: includes/admin-setting.php:896 includes/admin-setting.php:1267
840
+ msgid "on 29."
841
+ msgstr "29日"
842
+
843
+ #: includes/admin-setting.php:899 includes/admin-setting.php:1270
844
+ msgid "on 30."
845
+ msgstr "30日"
846
+
847
+ #: includes/admin-setting.php:902 includes/admin-setting.php:1273
848
+ msgid "on 31."
849
+ msgstr "31日"
850
+
851
+ #: includes/admin-setting.php:928 includes/admin-setting.php:1299
852
+ msgid "weekly"
853
+ msgstr "毎週"
854
+
855
+ #: includes/admin-setting.php:933 includes/admin-setting.php:1304
856
+ msgid "Sunday"
857
+ msgstr "日曜日"
858
+
859
+ #: includes/admin-setting.php:934 includes/admin-setting.php:1305
860
+ msgid "Monday"
861
+ msgstr "月曜日"
862
+
863
+ #: includes/admin-setting.php:935 includes/admin-setting.php:1306
864
+ msgid "Tuesday"
865
+ msgstr "火曜日"
866
+
867
+ #: includes/admin-setting.php:936 includes/admin-setting.php:1307
868
+ msgid "Wednesday"
869
+ msgstr "水曜日"
870
+
871
+ #: includes/admin-setting.php:937 includes/admin-setting.php:1308
872
+ msgid "Thursday"
873
+ msgstr "木曜日"
874
+
875
+ #: includes/admin-setting.php:938 includes/admin-setting.php:1309
876
+ msgid "Friday"
877
+ msgstr "金曜日"
878
+
879
+ #: includes/admin-setting.php:939 includes/admin-setting.php:1310
880
+ msgid "Saturday"
881
+ msgstr "土曜日"
882
+
883
+ #: includes/admin-setting.php:959 includes/admin-setting.php:1330
884
+ msgid "daily"
885
+ msgstr "毎日"
886
+
887
+ #: includes/admin-setting.php:1002
888
+ msgid "Feedly"
889
+ msgstr "Feedly"
890
+
891
+ #: includes/admin-setting.php:1010
892
+ msgid "Default: 86400 Minimum: 3600"
893
+ msgstr "既定値: 86400 最小値: 3600"
894
+
895
+ #: includes/admin-setting.php:1036
896
+ msgid "Default: Default"
897
+ msgstr "既定値: デフォルト"
898
+
899
+ #: includes/admin-setting.php:1064
900
+ msgid "Default: Enabled (Asynchronous 2nd Cache)"
901
+ msgstr "既定値: 有効(非同期2次キャッシュ)"
902
+
903
+ #: includes/admin-setting.php:1100
904
+ msgid "Default: On"
905
+ msgstr "既定値: 有効"
906
+
907
+ #: includes/admin-setting.php:1121
908
+ msgid "Default: Manual"
909
+ msgstr "既定値: 手動"
910
+
911
+ #: includes/admin-setting.php:1353
912
+ msgid "hourly"
913
+ msgstr "毎時"
914
+
915
+ #: includes/admin-setting.php:1388
916
+ msgid "Disk usage of exported file"
917
+ msgstr "エクスポートされたファイルのディスク使用量"
918
+
919
+ #: includes/admin-setting.php:1397
920
+ msgid "No exported file"
921
+ msgstr "エクスポートされたファイルは存在しません。"
922
+
923
+ #: includes/admin-setting.php:1409
924
+ msgid "Manual export"
925
+ msgstr "手動エクスポート"
926
+
927
+ #: includes/admin-setting.php:1413
928
+ msgid "Export share count to a csv file."
929
+ msgstr "シェア数をCSVファイルにエクスポートします。"
930
+
931
+ #: includes/admin-setting.php:1427
932
+ msgid "Reset of exported file"
933
+ msgstr "エクスポートされたファイルのリセット"
934
+
935
+ #: includes/admin-setting.php:1431
936
+ msgid "Clear exported csv file."
937
+ msgstr "エクスポートされたCSVファイルを削除します。"
938
+
939
+ #: includes/admin-setting.php:1442
940
+ msgid "Download of exported file"
941
+ msgstr "エクスポートされたファイルのダウンロード"
942
+
943
+ #: includes/admin-setting.php:1444 includes/download.php:38
944
+ msgid "Download"
945
+ msgstr "ダウンロード"
946
+
947
+ #: includes/admin-setting.php:1446
948
+ msgid "Download the exported csv file."
949
+ msgstr "エクスポートされたCSVファイルをダウンロードします。"
950
+
951
+ #: sns-count-cache.php:1223
952
+ msgid "Dashboard | SNS Count Cache"
953
+ msgstr "ダッシュボード | SNS Count Cache"
954
+
955
+ #: sns-count-cache.php:1224
956
+ msgid "Cache Status | SNS Count Cache"
957
+ msgstr "キャッシュ状況 | SNS Count Cache"
958
+
959
+ #: sns-count-cache.php:1225
960
+ msgid "Share Count | SNS Count Cache"
961
+ msgstr "シェア数 | SNS Count Cache"
962
+
963
+ #: sns-count-cache.php:1228
964
+ msgid "Hot Content | SNS Count Cache"
965
+ msgstr "話題のコンテンツ | SNS Count Cache"
966
+
967
+ #: sns-count-cache.php:1231
968
+ msgid "Setting | SNS Count Cache"
969
+ msgstr "設定 | SNS Count Cache"
970
+
971
+ #: sns-count-cache.php:1232
972
+ msgid "Help | SNS Count Cache"
973
+ msgstr "ヘルプ | SNS Count Cache"
974
+
975
+ #: sns-count-cache.php:1257 sns-count-cache.php:1272 sns-count-cache.php:1287
976
+ #: sns-count-cache.php:1301 sns-count-cache.php:1315 sns-count-cache.php:1329
977
+ #: sns-count-cache.php:1343 sns-count-cache.php:1357
978
+ msgid "You do not have sufficient permissions to access this page."
979
+ msgstr "このページにアクセスするために必要な権限がありません。"
980
+
981
+ #: sns-count-cache.php:1507
982
+ msgid "&laquo;"
983
+ msgstr ""
984
+
985
+ #: sns-count-cache.php:1508
986
+ msgid "&raquo;"
987
+ msgstr ""
988
+
989
+ #: sns-count-cache.php:1839 sns-count-cache.php:1847
990
+ msgid "Completed"
991
+ msgstr "完了"
992
+
993
+ #: sns-count-cache.php:1841 sns-count-cache.php:1849
994
+ msgid "Partially Completed"
995
+ msgstr "部分的完了"
996
+
997
+ #: sns-count-cache.php:1843 sns-count-cache.php:1851
998
+ msgid "Ongoing"
999
+ msgstr "進行中"
1000
+
1001
+ #. Plugin URI of the plugin/theme
1002
+ msgid "https://ja.wordpress.org/plugins/sns-count-cache/"
1003
+ msgstr ""
1004
+
1005
+ #. Description of the plugin/theme
1006
+ msgid ""
1007
+ "SNS Count Cache gets share count for Twitter and Facebook, Google Plus, "
1008
+ "Pocket, Hatena Bookmark and caches these count in the background. This plugin "
1009
+ "may help you to shorten page loading time because the share count can be "
1010
+ "retrieved not through network but through the cache using given functions."
1011
+ msgstr ""
1012
+ "SNS Count Cacheは、Twitter、Facebook、Google+、Pocket、はてなブックマークのシェ"
1013
+ "ア数を取得し、バックグラウンドでキャッシュします。用意された関数を利用すること"
1014
+ "で、ネットワーク経由でなくキャッシュからシェア数を参照できようになるため、ペー"
1015
+ "ジ読み込みの高速化が見込めます。"
1016
+
1017
+ #. Author of the plugin/theme
1018
+ msgid "Daisuke Maruyama"
1019
+ msgstr ""
1020
+
1021
+ #. Author URI of the plugin/theme
1022
+ msgid "http://marubon.info/"
1023
+ msgstr ""
1024
+
1025
+ #~ msgid "Additional custom post types"
1026
+ #~ msgstr "追加のカスタム投稿タイプ"
1027
+
1028
+ #~ msgid "on"
1029
+ #~ msgstr "on"
1030
+
1031
+ #~ msgid "What is SNS Cout Cache?"
1032
+ #~ msgstr "SNS Count Cacheは何なのか?"
1033
+
1034
+ #~ msgid ""
1035
+ #~ "SNS Count Cache gets share count for Twitter and Facebook, Google Plus, "
1036
+ #~ "Hatena Bookmark and caches these count in the background. This plugin may "
1037
+ #~ "help you to shorten page loading time because the share count can be "
1038
+ #~ "retrieved not through network but through the cache using given functions."
1039
+ #~ msgstr ""
1040
+ #~ "SNS Count Cacheは、Twitter、Facebook、Google+、はてなブックマーク、Pocketの"
1041
+ #~ "カウントをバックグラウンドで取得し、それらのカウントをキャッシュします。SNS"
1042
+ #~ "のカウントをネットワーク経由ではなく、キャッシュから取得することでページの読"
1043
+ #~ "み込み時間の短縮が可能になります。"
1044
+
1045
+ #~ msgid "How often does this plugin get and cache share count?"
1046
+ #~ msgstr "SNSカウントを取得、キャッシュする頻度は?"
1047
+
1048
+ #~ msgid ""
1049
+ #~ "Although this plugin gets share count of 20 posts at a time every 10 "
1050
+ #~ "minutes by default, you can modify the setting in the \"Setting\" tab in "
1051
+ #~ "the setting page."
1052
+ #~ msgstr ""
1053
+ #~ "デフォルトで10分ごとに20記事の取得するが、管理ページの設定タブにて変更が可能"
1054
+ #~ "です。"
1055
+
1056
+ #~ msgid ""
1057
+ #~ "Cache status is described in the \"Cache Status\" tab in the setting page."
1058
+ #~ msgstr "キャッシュ状態は、管理ページのキャッシュ状態タブにて確認可能です。"
1059
+
1060
+ #~ msgid "Status Overview"
1061
+ #~ msgstr "ステータス概要"
1062
+
1063
+ #~ msgid "Target feed type:"
1064
+ #~ msgstr "対象フィードタイプ:"
1065
+
1066
+ #~ msgid "Target feed:"
1067
+ #~ msgstr "対象フィード:"
1068
+
1069
+ #~ msgid "posts"
1070
+ #~ msgstr "posts"
1071
+
1072
+ #~ msgid "Number of contents to check at a time (posts)"
1073
+ #~ msgstr "一度にチェックするコンテンツ数(コンテンツ数)"
1074
+
1075
+ #~ msgid "Target Content"
1076
+ #~ msgstr "対象コンテンツ"
1077
+
1078
+ #~ msgid "Interval cheking and caching share count"
1079
+ #~ msgstr "シェア数をチェック、キャッシュする間隔"
1080
+
1081
+ #~ msgid "Number of posts to check at a time"
1082
+ #~ msgstr "一度にチェックするコンテンツ数"
1083
+
1084
+ #~ msgid "Interval cheking and caching share count(sec)"
1085
+ #~ msgstr "シェア数をチェック、キャッシュする間隔"
1086
+
1087
+ #~ msgid "Interval cheking and caching follower count"
1088
+ #~ msgstr "フォロー数をチェック、キャッシュする間隔"
1089
+
1090
+ #~ msgid "Interval cheking and caching share count (sec)"
1091
+ #~ msgstr "シェア数をチェック、キャッシュする間隔(秒)"
1092
+
1093
+ #~ msgid "Number of posts to check at a time (posts)"
1094
+ #~ msgstr "一度にチェックするコンテンツ数(コンテンツ数)"
1095
+
1096
+ #~ msgid "Interval cheking and caching follower count (sec)"
1097
+ #~ msgstr "シェア数をチェック、キャッシュする間隔(秒)"
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === SNS Count Cache ===
2
  Contributors: marubon
3
  Donate link:
4
  Tags: performance, SNS, social, cache, share
5
  Requires at least: 3.7
6
- Tested up to: 4.2.3
7
- Stable tag: 0.7.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -115,6 +115,11 @@ There are no questions.
115
  = 0.7.1 =
116
  * Modified: Check interval of follower count is tuned.
117
 
 
 
 
 
 
118
  == Upgrade Notice ==
119
  The following functions are deprecated.
120
 
1
+ === SNS Count Cache ===
2
  Contributors: marubon
3
  Donate link:
4
  Tags: performance, SNS, social, cache, share
5
  Requires at least: 3.7
6
+ Tested up to: 4.3
7
+ Stable tag: 0.8.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
115
  = 0.7.1 =
116
  * Modified: Check interval of follower count is tuned.
117
 
118
+ = 0.8.0 =
119
+ * Added: Japanese translation
120
+ * Improved: Cache processing is stabilized.
121
+ * Added: function to select feed type for feedly follower retrieval.
122
+
123
  == Upgrade Notice ==
124
  The following functions are deprecated.
125
 
sns-count-cache.php CHANGED
@@ -2,7 +2,8 @@
2
  /*
3
  Plugin Name: SNS Count Cache
4
  Description: SNS Count Cache gets share count for Twitter and Facebook, Google Plus, Pocket, Hatena Bookmark and caches these count in the background. This plugin may help you to shorten page loading time because the share count can be retrieved not through network but through the cache using given functions.
5
- Version: 0.7.1
 
6
  Author: Daisuke Maruyama
7
  Author URI: http://marubon.info/
8
  License: GPL2 or later
@@ -31,6 +32,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
31
 
32
  require_once ( dirname( __FILE__ ) . '/includes/class-common-util.php' );
33
  require_once ( dirname( __FILE__ ) . '/includes/class-wp-cron-util.php' );
 
34
 
35
  require_once ( dirname( __FILE__ ) . '/includes/interface-order.php' );
36
 
@@ -220,7 +222,42 @@ final class SNS_Count_Cache implements Order {
220
  * Type of crawl ssl verification
221
  */
222
  const OPT_COMMON_CRAWLER_SSL_VERIFY_OFF = false;
223
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  /**
225
  * Capability for admin
226
  */
@@ -266,6 +303,11 @@ final class SNS_Count_Cache implements Order {
266
  */
267
  const DB_FOLLOW_CACHE_TARGET = 'follow_cache_target';
268
 
 
 
 
 
 
269
  /**
270
  * Option key of checking interval for follow base cache
271
  */
@@ -434,7 +476,7 @@ final class SNS_Count_Cache implements Order {
434
  /**
435
  * Plugin version, used for cache-busting of style and script file references.
436
  */
437
- private $version = '0.7.1';
438
 
439
  /**
440
  * Instances of crawler
@@ -510,6 +552,11 @@ final class SNS_Count_Cache implements Order {
510
  * Check interval for follow base cache
511
  */
512
  private $follow_base_check_interval = 1800;
 
 
 
 
 
513
 
514
  /**
515
  * Dynamic cache mode
@@ -593,7 +640,7 @@ final class SNS_Count_Cache implements Order {
593
  private function __construct() {
594
  Common_Util::log( '[' . __METHOD__ . '] (line='. __LINE__ . ')' );
595
 
596
- //load_plugin_textdomain(self::DOMAIN, false, basename(dirname( __FILE__ )) . '/languages');
597
 
598
  register_activation_hook( __FILE__, array( $this, 'activate_plugin' ) );
599
  register_deactivation_hook( __FILE__, array( $this, 'deactivate_plugin' ) );
@@ -683,7 +730,7 @@ final class SNS_Count_Cache implements Order {
683
  } else {
684
  $this->follow_base_check_interval = self::OPT_FOLLOW_BASE_CHECK_INTERVAL;
685
  }
686
-
687
  if ( isset( $settings[self::DB_COMMON_DYNAMIC_CACHE_MODE] ) && $settings[self::DB_COMMON_DYNAMIC_CACHE_MODE] ) {
688
  $this->dynamic_cache_mode = (int) $settings[self::DB_COMMON_DYNAMIC_CACHE_MODE];
689
  } else {
@@ -757,6 +804,12 @@ final class SNS_Count_Cache implements Order {
757
  } else {
758
  $this->follow_base_cache_target[self::REF_FOLLOW_FEEDLY] = true;
759
  }
 
 
 
 
 
 
760
 
761
  if ( isset( $settings[self::DB_SHARE_CUSTOM_POST_TYPES] ) && $settings[self::DB_SHARE_CUSTOM_POST_TYPES] ) {
762
  $this->share_base_custom_post_types = $settings[self::DB_SHARE_CUSTOM_POST_TYPES];
@@ -781,9 +834,10 @@ final class SNS_Count_Cache implements Order {
781
  // Crawler
782
  $options = array(
783
  'crawl_method' => $this->crawler_method,
784
- 'timeout' => 10,
785
- 'ssl_verification' => $this->crawler_ssl_verification
786
- );
 
787
 
788
  $this->crawlers[self::REF_SHARE] = Share_Crawler::get_instance();
789
  $this->crawlers[self::REF_SHARE]->initialize( $options );
@@ -878,7 +932,8 @@ final class SNS_Count_Cache implements Order {
878
  'crawler' => $this->crawlers[self::REF_FOLLOW],
879
  'target_sns' => $this->follow_base_cache_target,
880
  'check_interval' => $this->follow_base_check_interval,
881
- 'scheme_migration_mode' => $this->scheme_migration_mode
 
882
  );
883
 
884
  $this->cache_engines[self::REF_FOLLOW_BASE] = Follow_Base_Cache_Engine::get_instance();
@@ -890,7 +945,8 @@ final class SNS_Count_Cache implements Order {
890
  'crawler' => $this->crawlers[self::REF_FOLLOW],
891
  'target_sns' => $this->follow_base_cache_target,
892
  'check_interval' => $this->follow_base_check_interval,
893
- 'scheme_migration_mode' => $this->scheme_migration_mode
 
894
  );
895
 
896
  $this->cache_engines[self::REF_FOLLOW_LAZY] = Follow_Lazy_Cache_Engine::get_instance();
2
  /*
3
  Plugin Name: SNS Count Cache
4
  Description: SNS Count Cache gets share count for Twitter and Facebook, Google Plus, Pocket, Hatena Bookmark and caches these count in the background. This plugin may help you to shorten page loading time because the share count can be retrieved not through network but through the cache using given functions.
5
+ Version: 0.8.0
6
+ Plugin URI: https://wordpress.org/plugins/sns-count-cache/
7
  Author: Daisuke Maruyama
8
  Author URI: http://marubon.info/
9
  License: GPL2 or later
32
 
33
  require_once ( dirname( __FILE__ ) . '/includes/class-common-util.php' );
34
  require_once ( dirname( __FILE__ ) . '/includes/class-wp-cron-util.php' );
35
+ require_once ( dirname( __FILE__ ) . '/includes/class-sleep-throttle.php' );
36
 
37
  require_once ( dirname( __FILE__ ) . '/includes/interface-order.php' );
38
 
222
  * Type of crawl ssl verification
223
  */
224
  const OPT_COMMON_CRAWLER_SSL_VERIFY_OFF = false;
225
+
226
+ /**
227
+ * crawler timeout
228
+ */
229
+ const OPT_COMMON_CRAWLER_TIMEOUT = 10;
230
+
231
+ /**
232
+ * crawler retry limit
233
+ */
234
+ const OPT_COMMON_CRAWLER_RETRY_LIMIT = 2;
235
+
236
+ /**
237
+ * Type of feed
238
+ */
239
+ const OPT_FEED_TYPE_DEFAULT = '';
240
+
241
+ /**
242
+ * Type of feed
243
+ */
244
+ const OPT_FEED_TYPE_RSS = 'rss';
245
+
246
+ /**
247
+ * Type of feed
248
+ */
249
+ const OPT_FEED_TYPE_RSS2 = 'rss2';
250
+
251
+ /**
252
+ * Type of feed
253
+ */
254
+ const OPT_FEED_TYPE_RDF = 'rdf';
255
+
256
+ /**
257
+ * Type of feed
258
+ */
259
+ const OPT_FEED_TYPE_ATOM = 'atom';
260
+
261
  /**
262
  * Capability for admin
263
  */
303
  */
304
  const DB_FOLLOW_CACHE_TARGET = 'follow_cache_target';
305
 
306
+ /**
307
+ * Option key of cache target for follow base cache
308
+ */
309
+ const DB_FOLLOW_FEED_TYPE = '';
310
+
311
  /**
312
  * Option key of checking interval for follow base cache
313
  */
476
  /**
477
  * Plugin version, used for cache-busting of style and script file references.
478
  */
479
+ private $version = '0.8.0';
480
 
481
  /**
482
  * Instances of crawler
552
  * Check interval for follow base cache
553
  */
554
  private $follow_base_check_interval = 1800;
555
+
556
+ /**
557
+ * Feed type to be followed
558
+ */
559
+ private $follow_feed_type = '';
560
 
561
  /**
562
  * Dynamic cache mode
640
  private function __construct() {
641
  Common_Util::log( '[' . __METHOD__ . '] (line='. __LINE__ . ')' );
642
 
643
+ load_plugin_textdomain( self::DOMAIN, false, basename( dirname( __FILE__ ) ) . '/languages' );
644
 
645
  register_activation_hook( __FILE__, array( $this, 'activate_plugin' ) );
646
  register_deactivation_hook( __FILE__, array( $this, 'deactivate_plugin' ) );
730
  } else {
731
  $this->follow_base_check_interval = self::OPT_FOLLOW_BASE_CHECK_INTERVAL;
732
  }
733
+
734
  if ( isset( $settings[self::DB_COMMON_DYNAMIC_CACHE_MODE] ) && $settings[self::DB_COMMON_DYNAMIC_CACHE_MODE] ) {
735
  $this->dynamic_cache_mode = (int) $settings[self::DB_COMMON_DYNAMIC_CACHE_MODE];
736
  } else {
804
  } else {
805
  $this->follow_base_cache_target[self::REF_FOLLOW_FEEDLY] = true;
806
  }
807
+
808
+ if ( isset( $settings[self::DB_FOLLOW_FEED_TYPE] ) && $settings[self::DB_FOLLOW_FEED_TYPE] ) {
809
+ $this->follow_feed_type = $settings[self::DB_FOLLOW_FEED_TYPE];
810
+ } else {
811
+ $this->follow_feed_type = self::OPT_FEED_TYPE_DEFAULT;
812
+ }
813
 
814
  if ( isset( $settings[self::DB_SHARE_CUSTOM_POST_TYPES] ) && $settings[self::DB_SHARE_CUSTOM_POST_TYPES] ) {
815
  $this->share_base_custom_post_types = $settings[self::DB_SHARE_CUSTOM_POST_TYPES];
834
  // Crawler
835
  $options = array(
836
  'crawl_method' => $this->crawler_method,
837
+ 'timeout' => self::OPT_COMMON_CRAWLER_TIMEOUT,
838
+ 'retry_limit' => self::OPT_COMMON_CRAWLER_RETRY_LIMIT,
839
+ 'ssl_verification' => $this->crawler_ssl_verification
840
+ );
841
 
842
  $this->crawlers[self::REF_SHARE] = Share_Crawler::get_instance();
843
  $this->crawlers[self::REF_SHARE]->initialize( $options );
932
  'crawler' => $this->crawlers[self::REF_FOLLOW],
933
  'target_sns' => $this->follow_base_cache_target,
934
  'check_interval' => $this->follow_base_check_interval,
935
+ 'scheme_migration_mode' => $this->scheme_migration_mode,
936
+ 'feed_type' => $this->follow_feed_type
937
  );
938
 
939
  $this->cache_engines[self::REF_FOLLOW_BASE] = Follow_Base_Cache_Engine::get_instance();
945
  'crawler' => $this->crawlers[self::REF_FOLLOW],
946
  'target_sns' => $this->follow_base_cache_target,
947
  'check_interval' => $this->follow_base_check_interval,
948
+ 'scheme_migration_mode' => $this->scheme_migration_mode,
949
+ 'feed_type' => $this->follow_feed_type
950
  );
951
 
952
  $this->cache_engines[self::REF_FOLLOW_LAZY] = Follow_Lazy_Cache_Engine::get_instance();