SEO SQUIRRLY™ - Version 5.1.2

Version Description

  • Added new features in Open Graph for the posts/pages
  • Added the SEO Settings Backup and Restore
  • Improved the SEO Live Assistant to recognize more languages and chars
  • Improved the communication with the API Server
  • Fixed the Analytics notification bar
  • Fixed the wp_is_writable for older wp versions
  • Fixed the Open Graph not to include non embed videos in meta
  • Fixed the Sitemap Ping option to remain switched on when is selected
Download this release

Release Info

Developer cifi
Plugin Icon 128x128 SEO SQUIRRLY™
Version 5.1.2
Comparing to
See all releases

Code changes from version 5.1.1 to 5.1.2

classes/SQ_Tools.php CHANGED
@@ -216,8 +216,11 @@ class SQ_Tools extends SQ_FrontController {
216
  *
217
  * @return void
218
  */
219
- public static function saveOptions($key, $value) {
220
- self::$options[$key] = $value;
 
 
 
221
  update_option(SQ_OPTION, json_encode(self::$options));
222
  }
223
 
@@ -239,6 +242,9 @@ class SQ_Tools extends SQ_FrontController {
239
  case 'png':
240
  header('Content-Type: image/png');
241
  break;
 
 
 
242
  }
243
  }
244
 
216
  *
217
  * @return void
218
  */
219
+ public static function saveOptions($key = null, $value = '') {
220
+ if (isset($key)) {
221
+ self::$options[$key] = $value;
222
+ }
223
+
224
  update_option(SQ_OPTION, json_encode(self::$options));
225
  }
226
 
242
  case 'png':
243
  header('Content-Type: image/png');
244
  break;
245
+ case'text':
246
+ header("Content-type: text/plain");
247
+ break;
248
  }
249
  }
250
 
config/paths.php CHANGED
@@ -40,7 +40,7 @@ if (is_dir($upload_dir['basedir'])) {
40
  wp_mkdir_p($upload_path);
41
  }
42
 
43
- if (is_dir($upload_path) && wp_is_writable($upload_path)) {
44
  define('_SQ_CACHE_DIR_', realpath($upload_path) . '/');
45
  define('_SQ_CACHE_URL_', $upload_dir['baseurl'] . '/' . _SQ_NAME_ . '/');
46
  }
40
  wp_mkdir_p($upload_path);
41
  }
42
 
43
+ if (is_dir($upload_path) && (function_exists('wp_is_writable') && wp_is_writable($upload_path))) {
44
  define('_SQ_CACHE_DIR_', realpath($upload_path) . '/');
45
  define('_SQ_CACHE_URL_', $upload_dir['baseurl'] . '/' . _SQ_NAME_ . '/');
46
  }
controllers/SQ_Menu.php CHANGED
@@ -68,7 +68,7 @@ class SQ_Menu extends SQ_FrontController {
68
  set_transient('sq_analytics', time(), (60 * 60 * 24 * 7));
69
  } else {
70
  $time_loaded = get_transient('sq_analytics');
71
- if (time() - $time_loaded > (60 * 60 * 24 * 3)) {
72
  SQ_Error::setError(__('Check out the Squirrly Analytics section. <a href="admin.php?page=sq_posts" title="Squirrly Analytics">Click here</a>', _SQ_PLUGIN_NAME_));
73
  }
74
  }
68
  set_transient('sq_analytics', time(), (60 * 60 * 24 * 7));
69
  } else {
70
  $time_loaded = get_transient('sq_analytics');
71
+ if (time() - $time_loaded > (60 * 60 * 24 * 3) && time() - $time_loaded < (60 * 60 * 24 * 14)) {
72
  SQ_Error::setError(__('Check out the Squirrly Analytics section. <a href="admin.php?page=sq_posts" title="Squirrly Analytics">Click here</a>', _SQ_PLUGIN_NAME_));
73
  }
74
  }
controllers/SQ_Post.php CHANGED
@@ -210,11 +210,11 @@ class SQ_Post extends SQ_FrontController {
210
  wp_schedule_single_event(time() + 60, 'sq_processApi');
211
  //Save the keyword for this post
212
  if ($json = $this->model->getKeyword($post_id)) {
213
- $json->keyword = SQ_Tools::getValue('sq_keyword');
214
  $this->model->saveKeyword($post_id, $json);
215
  } else {
216
  $args = array();
217
- $args['keyword'] = SQ_Tools::getValue('sq_keyword');
218
  $this->model->saveKeyword($post_id, json_decode(json_encode($args)));
219
  }
220
  }
210
  wp_schedule_single_event(time() + 60, 'sq_processApi');
211
  //Save the keyword for this post
212
  if ($json = $this->model->getKeyword($post_id)) {
213
+ $json->keyword = addslashes(SQ_Tools::getValue('sq_keyword'));
214
  $this->model->saveKeyword($post_id, $json);
215
  } else {
216
  $args = array();
217
+ $args['keyword'] = addslashes(SQ_Tools::getValue('sq_keyword'));
218
  $this->model->saveKeyword($post_id, json_decode(json_encode($args)));
219
  }
220
  }
core/SQ_BlockSettingsSeo/SQ_BlockSettingsSeo.php CHANGED
@@ -43,8 +43,8 @@ class SQ_BlockSettingsSeo extends SQ_BlockController {
43
  SQ_Tools::saveOptions('sq_auto_meta', (int) SQ_Tools::getValue('sq_auto_meta'));
44
  SQ_Tools::saveOptions('sq_auto_favicon', (int) SQ_Tools::getValue('sq_auto_favicon'));
45
 
46
- ///////////////////////////////////////////
47
- /////////////////////////////SOCIAL OPTION
48
  SQ_Tools::saveOptions('sq_auto_facebook', (int) SQ_Tools::getValue('sq_auto_facebook'));
49
  SQ_Tools::saveOptions('sq_auto_twitter', (int) SQ_Tools::getValue('sq_auto_twitter'));
50
 
@@ -53,8 +53,8 @@ class SQ_BlockSettingsSeo extends SQ_BlockController {
53
  SQ_Tools::saveOptions('sq_google_plus', $this->model->checkGoogleAccount(SQ_Tools::getValue('sq_google_plus')));
54
  SQ_Tools::saveOptions('sq_linkedin_account', $this->model->checkLinkeinAccount(SQ_Tools::getValue('sq_linkedin_account')));
55
 
56
- ///////////////////////////////////////////
57
- /////////////////////////////FIRST PAGE OPTIMIZATION
58
  SQ_Tools::saveOptions('sq_auto_seo', 0);
59
  if ($pageId = get_option('page_on_front')) {
60
  $meta = array();
@@ -78,8 +78,8 @@ class SQ_BlockSettingsSeo extends SQ_BlockController {
78
  SQ_Tools::saveOptions('sq_fp_keywords', SQ_Tools::getValue('sq_fp_keywords'));
79
  }
80
 
81
- ///////////////////////////////////////////
82
- /////////////////////////////SITEMAP OPTION
83
  SQ_Tools::saveOptions('sq_auto_sitemap', (int) SQ_Tools::getValue('sq_auto_sitemap'));
84
  SQ_Tools::saveOptions('sq_sitemap_frequency', SQ_Tools::getValue('sq_sitemap_frequency'));
85
  SQ_Tools::saveOptions('sq_sitemap_ping', (int) SQ_Tools::getValue('sq_sitemap_ping'));
@@ -112,14 +112,13 @@ class SQ_BlockSettingsSeo extends SQ_BlockController {
112
  }
113
  }
114
 
115
- ///////////////////////////////////////////
116
 
 
 
 
117
 
118
- SQ_Tools::saveOptions('sq_google_analytics', $this->model->checkGoogleAnalyticsCode(SQ_Tools::getValue('sq_google_analytics')));
119
- SQ_Tools::saveOptions('sq_facebook_insights', $this->model->checkFavebookInsightsCode(SQ_Tools::getValue('sq_facebook_insights')));
120
- SQ_Tools::saveOptions('sq_pinterest', $this->model->checkPinterestCode(SQ_Tools::getValue('sq_pinterest','',true)));
121
-
122
- ///////////////////////////////////////////JSONLD
123
 
124
  SQ_Tools::saveOptions('sq_auto_jsonld', (int) SQ_Tools::getValue('sq_auto_jsonld'));
125
  if (SQ_Tools::getIsset('sq_jsonld_type') && isset(SQ_Tools::$options['sq_jsonld'][SQ_Tools::getValue('sq_jsonld_type')])) {
@@ -132,8 +131,8 @@ class SQ_BlockSettingsSeo extends SQ_BlockController {
132
  }
133
  SQ_Tools::saveOptions('sq_jsonld_type', SQ_Tools::getValue('sq_jsonld_type'));
134
 
135
- ///////////////////////////////////////////
136
- /////////////////////////////FAVICON OPTION
137
 
138
  /* if there is an icon to upload */
139
  if (!empty($_FILES['favicon'])) {
@@ -144,6 +143,7 @@ class SQ_BlockSettingsSeo extends SQ_BlockController {
144
  }
145
  if ($return['message'] <> '') {
146
  define('SQ_MESSAGE_FAVICON', $return['message']);
 
147
  }
148
  }
149
 
@@ -224,13 +224,43 @@ class SQ_BlockSettingsSeo extends SQ_BlockController {
224
  $url = get_bloginfo('url');
225
  }
226
  $snippet = SQ_Tools::getSnippet($url);
227
- //SQ_Tools::dump($snippet);
228
 
229
- /* if((int)SQ_Tools::getValue('post_id') > 0)
230
- $snippet['url'] = get_permalink((int)SQ_Tools::getValue('post_id'));
231
- */
232
  echo json_encode($snippet);
233
  exit();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  }
235
  }
236
 
43
  SQ_Tools::saveOptions('sq_auto_meta', (int) SQ_Tools::getValue('sq_auto_meta'));
44
  SQ_Tools::saveOptions('sq_auto_favicon', (int) SQ_Tools::getValue('sq_auto_favicon'));
45
 
46
+ ///////////////////////////////////////////
47
+ /////////////////////////////SOCIAL OPTION
48
  SQ_Tools::saveOptions('sq_auto_facebook', (int) SQ_Tools::getValue('sq_auto_facebook'));
49
  SQ_Tools::saveOptions('sq_auto_twitter', (int) SQ_Tools::getValue('sq_auto_twitter'));
50
 
53
  SQ_Tools::saveOptions('sq_google_plus', $this->model->checkGoogleAccount(SQ_Tools::getValue('sq_google_plus')));
54
  SQ_Tools::saveOptions('sq_linkedin_account', $this->model->checkLinkeinAccount(SQ_Tools::getValue('sq_linkedin_account')));
55
 
56
+ ///////////////////////////////////////////
57
+ /////////////////////////////FIRST PAGE OPTIMIZATION
58
  SQ_Tools::saveOptions('sq_auto_seo', 0);
59
  if ($pageId = get_option('page_on_front')) {
60
  $meta = array();
78
  SQ_Tools::saveOptions('sq_fp_keywords', SQ_Tools::getValue('sq_fp_keywords'));
79
  }
80
 
81
+ ///////////////////////////////////////////
82
+ /////////////////////////////SITEMAP OPTION
83
  SQ_Tools::saveOptions('sq_auto_sitemap', (int) SQ_Tools::getValue('sq_auto_sitemap'));
84
  SQ_Tools::saveOptions('sq_sitemap_frequency', SQ_Tools::getValue('sq_sitemap_frequency'));
85
  SQ_Tools::saveOptions('sq_sitemap_ping', (int) SQ_Tools::getValue('sq_sitemap_ping'));
112
  }
113
  }
114
 
115
+ ///////////////////////////////////////////
116
 
117
+ SQ_Tools::saveOptions('sq_google_analytics', $this->model->checkGoogleAnalyticsCode(SQ_Tools::getValue('sq_google_analytics', '', true)));
118
+ SQ_Tools::saveOptions('sq_facebook_insights', $this->model->checkFavebookInsightsCode(SQ_Tools::getValue('sq_facebook_insights', '', true)));
119
+ SQ_Tools::saveOptions('sq_pinterest', $this->model->checkPinterestCode(SQ_Tools::getValue('sq_pinterest', '', true)));
120
 
121
+ ///////////////////////////////////////////JSONLD
 
 
 
 
122
 
123
  SQ_Tools::saveOptions('sq_auto_jsonld', (int) SQ_Tools::getValue('sq_auto_jsonld'));
124
  if (SQ_Tools::getIsset('sq_jsonld_type') && isset(SQ_Tools::$options['sq_jsonld'][SQ_Tools::getValue('sq_jsonld_type')])) {
131
  }
132
  SQ_Tools::saveOptions('sq_jsonld_type', SQ_Tools::getValue('sq_jsonld_type'));
133
 
134
+ ///////////////////////////////////////////
135
+ /////////////////////////////FAVICON OPTION
136
 
137
  /* if there is an icon to upload */
138
  if (!empty($_FILES['favicon'])) {
143
  }
144
  if ($return['message'] <> '') {
145
  define('SQ_MESSAGE_FAVICON', $return['message']);
146
+ SQ_Error::setError(SQ_MESSAGE_FAVICON . " <br /> ");
147
  }
148
  }
149
 
224
  $url = get_bloginfo('url');
225
  }
226
  $snippet = SQ_Tools::getSnippet($url);
 
227
 
228
+ SQ_Tools::setHeader('json');
 
 
229
  echo json_encode($snippet);
230
  exit();
231
+ case 'sq_backup':
232
+ SQ_Tools::setHeader('text');
233
+ header("Content-Disposition: attachment; filename=squirrly.txt");
234
+
235
+ if (function_exists('base64_encode')) {
236
+ echo base64_encode(json_encode(SQ_Tools::$options));
237
+ } else {
238
+ echo json_encode(SQ_Tools::$options);
239
+ }
240
+ exit();
241
+ break;
242
+ case 'sq_restore':
243
+ if (!empty($_FILES['sq_options']) && $_FILES['sq_options']['tmp_name'] <> '') {
244
+ $options = file_get_contents($_FILES['sq_options']['tmp_name']);
245
+ try {
246
+ if (function_exists('base64_encode') && base64_decode($options) <> '') {
247
+ $options = base64_decode($options);
248
+ }
249
+ $options = json_decode($options, true);
250
+ if (is_array($options)) {
251
+ SQ_Tools::$options = $options;
252
+ SQ_Tools::saveOptions();
253
+ SQ_Error::setError(__('Great! The backup is restored.', _SQ_PLUGIN_NAME_) . " <br /> ", 'success');
254
+ } else {
255
+ SQ_Error::setError(__('Error! The backup is not valid.', _SQ_PLUGIN_NAME_) . " <br /> ");
256
+ }
257
+ } catch (Exception $e) {
258
+ SQ_Error::setError(__('Error! The backup is not valid.', _SQ_PLUGIN_NAME_) . " <br /> ");
259
+ }
260
+ } else {
261
+ SQ_Error::setError(__('Error! You have to enter a previous saved backup file.', _SQ_PLUGIN_NAME_) . " <br /> ");
262
+ }
263
+ break;
264
  }
265
  }
266
 
core/config.xml CHANGED
@@ -39,7 +39,8 @@
39
  <action>sq_fix_tcduplicate</action>
40
  <action>sq_fix_titleduplicate</action>
41
  <action>sq_fix_descduplicate</action>
42
-
 
43
  <action>sq_warnings_off</action>
44
  </actions>
45
  <active>1</active>
39
  <action>sq_fix_tcduplicate</action>
40
  <action>sq_fix_titleduplicate</action>
41
  <action>sq_fix_descduplicate</action>
42
+ <action>sq_backup</action>
43
+ <action>sq_restore</action>
44
  <action>sq_warnings_off</action>
45
  </actions>
46
  <active>1</active>
models/SQ_BlockSettingsSeo.php CHANGED
@@ -66,8 +66,8 @@ class Model_SQ_BlockSettingsSeo {
66
  public function checkGoogleAnalyticsCode($code) {
67
  //echo $code;
68
  if ($code <> '') {
69
- if (strpos($code, '_gaq.push') !== false) {
70
- preg_match('/_gaq.push\(\[[\'\"]_setAccount[\'\"],\\s?[\'\"]([^\'\"]+)[\'\"]\]\)/i', $code, $result);
71
  if (isset($result[1]) && !empty($result[1]))
72
  $code = $result[1];
73
  }
@@ -83,7 +83,7 @@ class Model_SQ_BlockSettingsSeo {
83
  SQ_Error::setError(__("The code for Google Analytics is incorrect.", _SQ_PLUGIN_NAME_));
84
  }
85
  }
86
- return $code;
87
  }
88
 
89
  /**
66
  public function checkGoogleAnalyticsCode($code) {
67
  //echo $code;
68
  if ($code <> '') {
69
+ if (strpos($code, 'GoogleAnalyticsObject') !== false) {
70
+ preg_match('/ga\(\'create\',[^\'"]*[\'"]([^\'"]+)[\'"],/i', $code, $result);
71
  if (isset($result[1]) && !empty($result[1]))
72
  $code = $result[1];
73
  }
83
  SQ_Error::setError(__("The code for Google Analytics is incorrect.", _SQ_PLUGIN_NAME_));
84
  }
85
  }
86
+ return trim($code);
87
  }
88
 
89
  /**
models/SQ_Frontend.php CHANGED
@@ -19,6 +19,9 @@ class Model_SQ_Frontend {
19
  /** @var array */
20
  private $keywords;
21
 
 
 
 
22
  /** @var integer */
23
  private $min_title_length = 10;
24
 
@@ -186,10 +189,7 @@ class Model_SQ_Frontend {
186
  $this->title = $this->getCustomTitle();
187
 
188
  /* Get the thumb image from post */
189
- $images = $this->getImagesFromContent();
190
- if (isset($images[0])) {
191
- $this->thumb_image = $images[0]['src'];
192
- }
193
 
194
  //Add description in homepage if is set or add description in other pages if is not home page
195
  if ((SQ_Tools::$options['sq_auto_description'] == 1 && $this->isHomePage()) || !$this->isHomePage()) {
@@ -253,12 +253,6 @@ class Model_SQ_Frontend {
253
  $sq_twitter_creator = SQ_Tools::$options['sq_twitter_account'];
254
  $sq_twitter_site = SQ_Tools::$options['sq_twitter_account'];
255
 
256
- if (!isset($this->thumb_image) || $this->thumb_image == '') {
257
- $images = $this->getImagesFromContent();
258
- if (isset($images[0])) {
259
- $this->thumb_image = $images[0]['src'];
260
- }
261
- }
262
 
263
  $meta .= '<meta name="twitter:card" content="summary" />' . "\n";
264
 
@@ -267,7 +261,7 @@ class Model_SQ_Frontend {
267
  $meta .= sprintf('<meta name="twitter:url" content="%s">', $this->url) . "\n";
268
  $meta .= sprintf('<meta name="twitter:title" content="%s">', $this->title) . "\n";
269
  $meta .= (($this->description <> '') ? sprintf('<meta name="twitter:description" content="%s">', $this->description . ' | ' . $this->meta['blogname']) . "\n" : '');
270
- $meta .= ((isset($this->thumb_image) && $this->thumb_image <> '') ? sprintf('<meta name="twitter:image" content="%s">', $this->thumb_image) . "\n" : '');
271
  $meta .= (($this->meta['blogname'] <> '') ? sprintf('<meta name="twitter:domain" content="%s">', $this->meta['blogname']) . "\n" : '');
272
 
273
  return apply_filters('sq_twitter_card_meta', $meta);
@@ -306,13 +300,6 @@ class Model_SQ_Frontend {
306
  $meta = "\n";
307
  $image = '';
308
 
309
- if (!isset($this->thumb_image) || $this->thumb_image == '') {
310
- $images = $this->getImagesFromContent();
311
- if (isset($images[0])) {
312
- $this->thumb_image = $images[0]['src'];
313
- }
314
- }
315
-
316
  if (!isset($this->thumb_video) || $this->thumb_video == '') {
317
  $videos = $this->getVideosFromContent();
318
  if (isset($videos[0])) {
@@ -325,19 +312,29 @@ class Model_SQ_Frontend {
325
  }
326
  //GET THE URL
327
  $meta .= sprintf('<meta property="og:url" content="%s" />', apply_filters('sq_open_graph_url', $this->url)) . "\n";
328
- if (isset($this->thumb_image) && $this->thumb_image <> '') {
329
- $meta .= sprintf('<meta property="og:image" content="%s" />', $this->thumb_image) . "\n";
330
- $meta .= sprintf('<meta property="og:image:width" content="%s" />', 500) . "\n";
 
 
 
 
331
  }
332
 
333
  if ((isset($this->thumb_video) && $this->thumb_video <> '')) {
 
334
  $meta .= sprintf('<meta property="og:video" content="%s" />', $this->thumb_video) . "\n";
 
 
335
  }
336
 
337
  $meta .= sprintf('<meta property="og:title" content="%s" />', $this->title) . "\n";
338
  $meta .= sprintf('<meta property="og:description" content="%s" />', $this->description) . "\n";
339
  $meta .= (($this->meta['blogname'] <> '') ? sprintf('<meta property="og:site_name" content="%s" />', apply_filters('sq_open_graph_site', $this->meta['blogname'])) . "\n" : '');
340
 
 
 
 
341
  if (is_author()) {
342
  $author = get_queried_object();
343
 
@@ -345,17 +342,19 @@ class Model_SQ_Frontend {
345
  $meta .= sprintf('<meta property="profile:first_name" content="%s" />', get_the_author_meta('first_name', $author->ID)) . "\n";
346
  $meta .= sprintf('<meta property="profile:last_name" content="%s" />', get_the_author_meta('last_name', $author->ID)) . "\n";
347
  } elseif (!$this->isHomePage() && (is_single() || is_page())) {
348
- if ((isset($this->thumb_video) && $this->thumb_video <> '')) {
349
- $meta .= sprintf('<meta property="og:type" content="%s" />', 'video') . "\n";
350
- } else {
351
- $meta .= sprintf('<meta property="og:type" content="%s" />', 'article') . "\n";
352
- $meta .= sprintf('<meta property="article:published_time" content="%s" />', get_the_time('c', $this->post->ID)) . "\n";
353
- if ($this->keywords <> '') {
354
- $keywords = preg_split('/[,]+/', $this->keywords);
355
- if (is_array($keywords) && !empty($keywords)) {
356
- foreach ($keywords as $keyword) {
357
- $meta .= sprintf('<meta property="article:tag" content="%s" />', $keyword) . "\n";
358
- }
 
 
359
  }
360
  }
361
  }
@@ -527,6 +526,8 @@ class Model_SQ_Frontend {
527
  'src' => esc_url($url),
528
  'title' => $this->clearTitle($this->grabTitleFromPost($post->ID)),
529
  'description' => $this->clearDescription($this->grabDescriptionFromPost($post->ID)),
 
 
530
  );
531
  }
532
  if (has_post_thumbnail($post->ID)) {
@@ -536,6 +537,8 @@ class Model_SQ_Frontend {
536
  'src' => esc_url($url[0]),
537
  'title' => $this->clearTitle($attachment->post_title),
538
  'description' => $this->clearDescription($attachment->post_excerpt),
 
 
539
  );
540
  }
541
  if (isset($post->post_content)) {
@@ -552,6 +555,8 @@ class Model_SQ_Frontend {
552
  'src' => esc_url($match[1]),
553
  'title' => $this->clearTitle(!empty($alt[1]) ? $alt[1] : ''),
554
  'description' => '',
 
 
555
  );
556
  }
557
  }
@@ -576,7 +581,7 @@ class Model_SQ_Frontend {
576
 
577
  if ($post && isset($post->ID)) {
578
  if (isset($post->post_content)) {
579
- preg_match('/(?:http(?:s)?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?&\"\'>\s]+)/si', $post->post_content, $match);
580
 
581
  if (isset($match[0])) {
582
  if (strpos($match[0], '//') !== false && strpos($match[0], 'http') === false) {
@@ -767,12 +772,12 @@ class Model_SQ_Frontend {
767
  $meta = '';
768
 
769
  $name = $this->getAuthor();
770
- if (!$name) {
771
  $name = $this->meta['blogname'];
772
  }
773
 
774
  if ($name <> '') {
775
- $meta = sprintf("<meta name=\"dcterms.rightsHolder\" content=\"%s\" />" . "\n", apply_filters('sq_copyright', $meta));
776
  }
777
 
778
  return apply_filters('sq_copyright_meta', $meta);
@@ -839,14 +844,13 @@ class Model_SQ_Frontend {
839
  private function getLanguage() {
840
  $meta = '';
841
  $language = get_bloginfo('language');
842
- $hreflang = SQ_ObjController::getController('SQ_Ranking', false)->getLanguage();
843
-
844
- if ($hreflang <> '') {
845
- $url = get_bloginfo('url');
846
- $meta .= sprintf("<link rel=\"alternate\" hreflang=\"%s\" href=\"$url\" />", $hreflang) . "\n";
847
- }
848
 
849
  if ($language <> '') {
 
 
 
 
 
850
  $meta .= sprintf("<meta name=\"dc.language\" content=\"%s\" />", $language) . "\n";
851
  }
852
 
@@ -1059,8 +1063,8 @@ class Model_SQ_Frontend {
1059
  if (isset($this->description))
1060
  $meta .= '"headline": "' . $this->description . '"' . $sep;
1061
  $meta .= '"url": "' . $this->url . '"' . $sep;
1062
- if (isset($this->thumb_image) && $this->thumb_image <> '')
1063
- $meta .= '"thumbnailUrl": "' . $this->thumb_image . '"' . $sep;
1064
  if (isset($this->post->post_date))
1065
  $meta .= '"dateCreated": "' . date('c', strtotime($this->post->post_date)) . '"' . $sep;
1066
  $meta .= '"author": {"@type": "Person", "url": "' . $this->getAuthor('user_url') . '", "name": "' . $this->getAuthor('display_name') . '"}' . $sep;
@@ -1363,6 +1367,7 @@ class Model_SQ_Frontend {
1363
  }
1364
 
1365
  if (isset($this->author)) {
 
1366
  if ($what == 'user_url' && $this->author->$what == '') {
1367
  return get_author_posts_url($this->author->ID, $this->author->user_nicename);
1368
  }if (isset($this->author->$what)) {
19
  /** @var array */
20
  private $keywords;
21
 
22
+ /** @var array */
23
+ private $thumb_images;
24
+
25
  /** @var integer */
26
  private $min_title_length = 10;
27
 
189
  $this->title = $this->getCustomTitle();
190
 
191
  /* Get the thumb image from post */
192
+ $this->thumb_images = $this->getImagesFromContent();
 
 
 
193
 
194
  //Add description in homepage if is set or add description in other pages if is not home page
195
  if ((SQ_Tools::$options['sq_auto_description'] == 1 && $this->isHomePage()) || !$this->isHomePage()) {
253
  $sq_twitter_creator = SQ_Tools::$options['sq_twitter_account'];
254
  $sq_twitter_site = SQ_Tools::$options['sq_twitter_account'];
255
 
 
 
 
 
 
 
256
 
257
  $meta .= '<meta name="twitter:card" content="summary" />' . "\n";
258
 
261
  $meta .= sprintf('<meta name="twitter:url" content="%s">', $this->url) . "\n";
262
  $meta .= sprintf('<meta name="twitter:title" content="%s">', $this->title) . "\n";
263
  $meta .= (($this->description <> '') ? sprintf('<meta name="twitter:description" content="%s">', $this->description . ' | ' . $this->meta['blogname']) . "\n" : '');
264
+ $meta .= (!empty($this->thumb_images) ? sprintf('<meta name="twitter:image" content="%s">', $this->thumb_images[0]['src']) . "\n" : '');
265
  $meta .= (($this->meta['blogname'] <> '') ? sprintf('<meta name="twitter:domain" content="%s">', $this->meta['blogname']) . "\n" : '');
266
 
267
  return apply_filters('sq_twitter_card_meta', $meta);
300
  $meta = "\n";
301
  $image = '';
302
 
 
 
 
 
 
 
 
303
  if (!isset($this->thumb_video) || $this->thumb_video == '') {
304
  $videos = $this->getVideosFromContent();
305
  if (isset($videos[0])) {
312
  }
313
  //GET THE URL
314
  $meta .= sprintf('<meta property="og:url" content="%s" />', apply_filters('sq_open_graph_url', $this->url)) . "\n";
315
+ if (!empty($this->thumb_images)) {
316
+ foreach ($this->thumb_images as $image) {
317
+ $meta .= sprintf('<meta property="og:image" content="%s" />', $image['src']) . "\n";
318
+ $meta .= sprintf('<meta property="og:image:width" content="%s" />', (isset($image['width']) ? $image['width'] : 500)) . "\n";
319
+ if (isset($image['height']))
320
+ $meta .= sprintf('<meta property="og:image:height" content="%s" />', $image['height']) . "\n";
321
+ }
322
  }
323
 
324
  if ((isset($this->thumb_video) && $this->thumb_video <> '')) {
325
+ $this->thumb_video = preg_replace('/(?:http(?:s)?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?&\"\'>\s]+)/si', "https://www.youtube.com/v/$1", $this->thumb_video);
326
  $meta .= sprintf('<meta property="og:video" content="%s" />', $this->thumb_video) . "\n";
327
+ $meta .= sprintf('<meta property="og:video:width" content="%s" />', 500) . "\n";
328
+ $meta .= sprintf('<meta property="og:video:height" content="%s" />', 280) . "\n";
329
  }
330
 
331
  $meta .= sprintf('<meta property="og:title" content="%s" />', $this->title) . "\n";
332
  $meta .= sprintf('<meta property="og:description" content="%s" />', $this->description) . "\n";
333
  $meta .= (($this->meta['blogname'] <> '') ? sprintf('<meta property="og:site_name" content="%s" />', apply_filters('sq_open_graph_site', $this->meta['blogname'])) . "\n" : '');
334
 
335
+ $language = get_bloginfo('language');
336
+ $meta .= sprintf('<meta property="og:locale" content="%s" />', str_replace("-", "_", $language)) . "\n";
337
+
338
  if (is_author()) {
339
  $author = get_queried_object();
340
 
342
  $meta .= sprintf('<meta property="profile:first_name" content="%s" />', get_the_author_meta('first_name', $author->ID)) . "\n";
343
  $meta .= sprintf('<meta property="profile:last_name" content="%s" />', get_the_author_meta('last_name', $author->ID)) . "\n";
344
  } elseif (!$this->isHomePage() && (is_single() || is_page())) {
345
+
346
+
347
+ $meta .= sprintf('<meta property="og:type" content="%s" />', 'article') . "\n";
348
+ $meta .= sprintf('<meta property="article:published_time" content="%s" />', get_the_time('c', $this->post->ID)) . "\n";
349
+ $category = get_the_category($this->post->ID);
350
+ if (!empty($category) && $category[0]->cat_name <> 'Uncategorized') {
351
+ $meta .= sprintf('<meta property="article:section" content="%s" />', $category[0]->cat_name) . "\n";
352
+ }
353
+ if ($this->keywords <> '') {
354
+ $keywords = preg_split('/[,]+/', $this->keywords);
355
+ if (is_array($keywords) && !empty($keywords)) {
356
+ foreach ($keywords as $keyword) {
357
+ $meta .= sprintf('<meta property="article:tag" content="%s" />', $keyword) . "\n";
358
  }
359
  }
360
  }
526
  'src' => esc_url($url),
527
  'title' => $this->clearTitle($this->grabTitleFromPost($post->ID)),
528
  'description' => $this->clearDescription($this->grabDescriptionFromPost($post->ID)),
529
+ 'width' => null,
530
+ 'height' => null,
531
  );
532
  }
533
  if (has_post_thumbnail($post->ID)) {
537
  'src' => esc_url($url[0]),
538
  'title' => $this->clearTitle($attachment->post_title),
539
  'description' => $this->clearDescription($attachment->post_excerpt),
540
+ 'width' => $url[1],
541
+ 'height' => $url[2],
542
  );
543
  }
544
  if (isset($post->post_content)) {
555
  'src' => esc_url($match[1]),
556
  'title' => $this->clearTitle(!empty($alt[1]) ? $alt[1] : ''),
557
  'description' => '',
558
+ 'width' => null,
559
+ 'height' => null,
560
  );
561
  }
562
  }
581
 
582
  if ($post && isset($post->ID)) {
583
  if (isset($post->post_content)) {
584
+ preg_match('/(?:http(?:s)?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed)\/)([^\?&\"\'>\s]+)/si', apply_filters('the_content', $post->post_content), $match);
585
 
586
  if (isset($match[0])) {
587
  if (strpos($match[0], '//') !== false && strpos($match[0], 'http') === false) {
772
  $meta = '';
773
 
774
  $name = $this->getAuthor();
775
+ if ($name == '') {
776
  $name = $this->meta['blogname'];
777
  }
778
 
779
  if ($name <> '') {
780
+ $meta = sprintf("<meta name=\"dcterms.rightsHolder\" content=\"%s\" />" . "\n", apply_filters('sq_copyright', $name));
781
  }
782
 
783
  return apply_filters('sq_copyright_meta', $meta);
844
  private function getLanguage() {
845
  $meta = '';
846
  $language = get_bloginfo('language');
 
 
 
 
 
 
847
 
848
  if ($language <> '') {
849
+ $url = get_bloginfo('url');
850
+ if (strpos($language, '-') !== false) {
851
+ $hreflang = substr($language, 0, strpos($language, '-'));
852
+ }
853
+ $meta .= sprintf("<link rel=\"alternate\" hreflang=\"%s\" href=\"%s\" />", $hreflang, $url) . "\n";
854
  $meta .= sprintf("<meta name=\"dc.language\" content=\"%s\" />", $language) . "\n";
855
  }
856
 
1063
  if (isset($this->description))
1064
  $meta .= '"headline": "' . $this->description . '"' . $sep;
1065
  $meta .= '"url": "' . $this->url . '"' . $sep;
1066
+ if (!empty($this->thumb_images))
1067
+ $meta .= '"thumbnailUrl": "' . $this->thumb_images[0]['src'] . '"' . $sep;
1068
  if (isset($this->post->post_date))
1069
  $meta .= '"dateCreated": "' . date('c', strtotime($this->post->post_date)) . '"' . $sep;
1070
  $meta .= '"author": {"@type": "Person", "url": "' . $this->getAuthor('user_url') . '", "name": "' . $this->getAuthor('display_name') . '"}' . $sep;
1367
  }
1368
 
1369
  if (isset($this->author)) {
1370
+
1371
  if ($what == 'user_url' && $this->author->$what == '') {
1372
  return get_author_posts_url($this->author->ID, $this->author->user_nicename);
1373
  }if (isset($this->author->$what)) {
readme.txt CHANGED
@@ -1,4 +1,4 @@
1
- === SEO by SQUIRRLY ===
2
  Contributors: cifi, calinvingan, florinmuresan
3
  Tags: seo,seo plugin,wordpress seo,seo optimization,seo content,plugin,content seo,search engine optimization,xml,sitemap,keyword,keyword research,post,posts,page,multisite,squirrly,wordpress,tag,image,images,photos,flickr,statistics,stats,google,content,title,description,favicon,mobile,canonical,author,google plus,analytics,admin,seo correction,seo title,seo meta,meta,google,twitter,news,blog,e-commerce,ecommerce,woocommerce,feed,feeds,marketing,buddypress,social,social media,url,automatic,iphone
4
  Requires at least: 3.5
@@ -15,7 +15,7 @@ Recommended by <a href="http://www.quicksprout.com/university/how-to-maximize-yo
15
 
16
  [youtube https://www.youtube.com/watch?v=mEjrE7TuDDc]
17
 
18
- See all the Squirrly SEO features at: http://howto.squirrly.co/category/sides/
19
 
20
  Based on the topic you're writing about, the interface will light up green while you're editing your text, so that you know you've done something right. When all the lights are green, you can publish it, because your text has excellent SEO and it's 100% optimized.
21
 
@@ -27,7 +27,7 @@ The best things is: YOU DON'T have to be an SEO expert to use it. Wait, you don'
27
 
28
  Squirrly is a Freemium software, like MailChimp.
29
 
30
- You’ll start with the free version of Squirrly SEO. It will help you if you have small content marketing needs, such as 3 articles published / month, 5 keyword analysis and a weekly audit report. When you'll require more, you can pay for the PRO Plan.
31
 
32
  - <strong>Gives You SEO Advice as you're typing your articles.</strong> Squirrly helps you in real time to optimize your articles to 100%, while you are writing or editing them.
33
 
@@ -86,7 +86,7 @@ Over 120 Content Marketing Experts have reviewed our wordpress SEO plugin and lo
86
 
87
  Over 650 students to our $147 Content Marketing Training on Udemy. Part of that training you'll be receiving for free when signing up for this wordpress seo plugin.
88
 
89
- +285% increase in traffic to over 36,500 survey participants.
90
 
91
  Recently our team grew to 7 people
92
 
@@ -135,11 +135,22 @@ Type a keyword to the right of the screen and start using Squirrly Seo. Enjoy!
135
 
136
 
137
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
138
  = 5.1.1 =
 
 
139
  * Fixed the feed style issue
140
- * Added the custom size image for Open Graph in Squirrly Snippet
141
  * Increased the plugin loading speed in front-end
142
- * Improved the communication with the API Server
143
  * Fixed the post optimization history issue
144
  * Fixed the encryption for the password and fixed the bad login issue
145
  * Compatible with WP 4.2.2
@@ -356,7 +367,7 @@ You can opt-in to use the Advanced SEO Settings, which will allow you to customi
356
  Yes, you just have to install the plugin from the WP directory into your site. Then connect with your email to Squirrly. The Free Version will automatically start. Read below for more. Once you have bigger content marketing needs, you can opt-in to upgrade to the PRO Plan.
357
 
358
  = Does the Free Plan offer all the features? =
359
- Yes. As of January 2014 all the features are also included in the free plan. There is NO trial period, NO other features that can be activated by paying money for the plugin. The free version has all a small wordpress site or blog needs to get started with SEO and Content Marketing. These are the blogs on which owners want to publish about 3 articles / month, analyze 5 different seo keywords, need a general Audit of their whole site and want to see the SEO analytics for their last posts.
360
 
361
  = What about the PRO Plan? =
362
  The PRO Plan is for those with bigger content marketing and SEO needs. For anything regarding the paid plans, go to our website: squirrly.co | The wordpress directory listing is only to be used for concerns regarding the Free version. You can get the PRO Plan after you've installed the plugin from this directory.
1
+ === SEO by SQUIRRLY ===
2
  Contributors: cifi, calinvingan, florinmuresan
3
  Tags: seo,seo plugin,wordpress seo,seo optimization,seo content,plugin,content seo,search engine optimization,xml,sitemap,keyword,keyword research,post,posts,page,multisite,squirrly,wordpress,tag,image,images,photos,flickr,statistics,stats,google,content,title,description,favicon,mobile,canonical,author,google plus,analytics,admin,seo correction,seo title,seo meta,meta,google,twitter,news,blog,e-commerce,ecommerce,woocommerce,feed,feeds,marketing,buddypress,social,social media,url,automatic,iphone
4
  Requires at least: 3.5
15
 
16
  [youtube https://www.youtube.com/watch?v=mEjrE7TuDDc]
17
 
18
+ See all the Squirrly SEO features at: http://howto.squirrly.co
19
 
20
  Based on the topic you're writing about, the interface will light up green while you're editing your text, so that you know you've done something right. When all the lights are green, you can publish it, because your text has excellent SEO and it's 100% optimized.
21
 
27
 
28
  Squirrly is a Freemium software, like MailChimp.
29
 
30
+ You’ll start with the free version of Squirrly SEO. It will help you if you have small content marketing needs, such as 5 articles published / month, 5 keyword analysis and a weekly audit report. When you'll require more, you can pay for the PRO Plan.
31
 
32
  - <strong>Gives You SEO Advice as you're typing your articles.</strong> Squirrly helps you in real time to optimize your articles to 100%, while you are writing or editing them.
33
 
86
 
87
  Over 650 students to our $147 Content Marketing Training on Udemy. Part of that training you'll be receiving for free when signing up for this wordpress seo plugin.
88
 
89
+ over +285% increase in traffic to over 36,500 survey participants.
90
 
91
  Recently our team grew to 7 people
92
 
135
 
136
 
137
  == Changelog ==
138
+ = 5.1.2 =
139
+ * Added new features in Open Graph for the posts/pages
140
+ * Added the SEO Settings Backup and Restore
141
+ * Improved the SEO Live Assistant to recognize more languages and chars
142
+ * Improved the communication with the API Server
143
+ * Fixed the Analytics notification bar
144
+ * Fixed the wp_is_writable for older wp versions
145
+ * Fixed the Open Graph not to include non embed videos in meta
146
+ * Fixed the Sitemap Ping option to remain switched on when is selected
147
+
148
  = 5.1.1 =
149
+ * Corrected the css for the top yellow bar
150
+ * Get the keyword from database for the saved article
151
  * Fixed the feed style issue
152
+ * Added the custom size image for Open Graph in Squirrly SEO Snippet
153
  * Increased the plugin loading speed in front-end
 
154
  * Fixed the post optimization history issue
155
  * Fixed the encryption for the password and fixed the bad login issue
156
  * Compatible with WP 4.2.2
367
  Yes, you just have to install the plugin from the WP directory into your site. Then connect with your email to Squirrly. The Free Version will automatically start. Read below for more. Once you have bigger content marketing needs, you can opt-in to upgrade to the PRO Plan.
368
 
369
  = Does the Free Plan offer all the features? =
370
+ As of January 2015 the free plan will include the Lite version of our features. The paid version will open the Full version of our features. The free version has all a small wordpress site or blog needs to get started with SEO and Content Marketing. These are the blogs on which owners want to publish about 5 articles / month. Also includes a general Audit of their whole site and want to see the SEO analytics for their last posts.
371
 
372
  = What about the PRO Plan? =
373
  The PRO Plan is for those with bigger content marketing and SEO needs. For anything regarding the paid plans, go to our website: squirrly.co | The wordpress directory listing is only to be used for concerns regarding the Free version. You can get the PRO Plan after you've installed the plugin from this directory.
squirrly.php CHANGED
@@ -8,12 +8,12 @@
8
  Plugin URI: http://www.squirrly.co
9
  Description: SEO Plugin By Squirrly is for the NON-SEO experts. Get Excellent Seo with Better Content, Ranking and Analytics. For Both Humans and Search Bots.<BR> <a href="http://my.squirrly.co/user" target="_blank"><strong>Check your profile</strong></a>
10
  Author: cifi, calinvingan, florinmuresan
11
- Version: 5.1.1
12
  Author URI: http://www.squirrly.co
13
  */
14
 
15
  /* SET THE CURRENT VERSION ABOVE AND BELOW */
16
- define('SQ_VERSION', '5.1.1');
17
  /* Call config files */
18
  if (file_exists(dirname(__FILE__) . '/config/config.php')) {
19
  require(dirname(__FILE__) . '/config/config.php');
8
  Plugin URI: http://www.squirrly.co
9
  Description: SEO Plugin By Squirrly is for the NON-SEO experts. Get Excellent Seo with Better Content, Ranking and Analytics. For Both Humans and Search Bots.<BR> <a href="http://my.squirrly.co/user" target="_blank"><strong>Check your profile</strong></a>
10
  Author: cifi, calinvingan, florinmuresan
11
+ Version: 5.1.2
12
  Author URI: http://www.squirrly.co
13
  */
14
 
15
  /* SET THE CURRENT VERSION ABOVE AND BELOW */
16
+ define('SQ_VERSION', '5.1.2');
17
  /* Call config files */
18
  if (file_exists(dirname(__FILE__) . '/config/config.php')) {
19
  require(dirname(__FILE__) . '/config/config.php');
themes/default/SQ_BlockDashboard.php CHANGED
@@ -2,8 +2,12 @@
2
  <?php SQ_ObjController::getBlock('SQ_BlockSupport')->init(); ?>
3
  <?php if (SQ_Tools::$options['sq_api'] == '') { ?>
4
  <span class="sq_icon"></span>
 
5
  <div id="sq_settings_title" ><?php _e('Connect to Squirrly.co', _SQ_PLUGIN_NAME_); ?> </div>
6
- <div id="sq_settings_login"><?php SQ_ObjController::getBlock('SQ_Blocklogin')->init(); ?></div>
 
 
 
7
 
8
  <div class="sq_login_link"><?php _e('Connect to Squirrly and start optimizing your site', _SQ_PLUGIN_NAME_); ?></div>
9
  <input id="sq_goto_dashboard" style="display:none; margin: 0 auto; width: 500px; padding: 0px 10px;" type="button" value="&laquo;<?php _e('START HERE', _SQ_PLUGIN_NAME_) ?> &raquo;" />
2
  <?php SQ_ObjController::getBlock('SQ_BlockSupport')->init(); ?>
3
  <?php if (SQ_Tools::$options['sq_api'] == '') { ?>
4
  <span class="sq_icon"></span>
5
+
6
  <div id="sq_settings_title" ><?php _e('Connect to Squirrly.co', _SQ_PLUGIN_NAME_); ?> </div>
7
+ <div id="sq_settings_login">
8
+ <?php SQ_ObjController::getBlock('SQ_Blocklogin')->init(); ?>
9
+ </div>
10
+
11
 
12
  <div class="sq_login_link"><?php _e('Connect to Squirrly and start optimizing your site', _SQ_PLUGIN_NAME_); ?></div>
13
  <input id="sq_goto_dashboard" style="display:none; margin: 0 auto; width: 500px; padding: 0px 10px;" type="button" value="&laquo;<?php _e('START HERE', _SQ_PLUGIN_NAME_) ?> &raquo;" />
themes/default/SQ_BlockSettings.php CHANGED
@@ -286,6 +286,26 @@
286
  </div>
287
  </div>
288
  </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
289
  </div>
290
 
291
  </div>
286
  </div>
287
  </div>
288
  </form>
289
+
290
+ <div class="sq_settings_backup">
291
+ <form action="" method="POST">
292
+ <input type="hidden" name="action" value="sq_backup" />
293
+ <input type="hidden" name="nonce" value="<?php echo wp_create_nonce(_SQ_NONCE_ID_); ?>" />
294
+ <input type="submit" class="sq_button" name="sq_backup" value="<?php _e('Backup Settings', _SQ_PLUGIN_NAME_) ?>" />
295
+ <input type="button" class="sq_button sq_restore" name="sq_restore" value="<?php _e('Restore Settings', _SQ_PLUGIN_NAME_) ?>" />
296
+ </form>
297
+ </div>
298
+
299
+ <div class="sq_settings_restore sq_popup" style="display: none">
300
+ <span class="sq_close">x</span>
301
+ <span><?php _e('Upload the file with the saved Squirrly Settings', _SQ_PLUGIN_NAME_) ?></span>
302
+ <form action="" method="POST" enctype="multipart/form-data">
303
+ <input type="hidden" name="action" value="sq_restore" />
304
+ <input type="file" name="sq_options" id="favicon" style="float: left;" />
305
+ <input type="hidden" name="nonce" value="<?php echo wp_create_nonce(_SQ_NONCE_ID_); ?>" />
306
+ <input type="submit" style="margin-top: 10px;" class="sq_button" name="sq_restore" value="<?php _e('Restore Backup', _SQ_PLUGIN_NAME_) ?>" />
307
+ </form>
308
+ </div>
309
  </div>
310
 
311
  </div>
themes/default/SQ_BlockSettingsSeo.php CHANGED
@@ -132,7 +132,6 @@
132
  <legend class="sq_legend_medium">
133
  <span class="sq_legend_title"><?php _e('First page optimization', _SQ_PLUGIN_NAME_); ?></span>
134
  <span><?php echo sprintf(__('%sThe best SEO approach to Meta information%s', _SQ_PLUGIN_NAME_), '<a href="http://www.squirrly.co/the-best-seo-approach-to-meta-information" target="_blank">', '</a>'); ?></span>
135
-
136
  <span><?php _e('Add meta <strong>title</strong> in Home Page', _SQ_PLUGIN_NAME_); ?></span>
137
  <?php
138
  $auto_option = false;
@@ -163,8 +162,10 @@
163
  <label for="sq_auto_description0" class="sq_switch-label sq_switch-label-on"><?php _e('No', _SQ_PLUGIN_NAME_); ?></label>
164
  <span class="sq_switch-selection"></span>
165
  </div>
166
-
167
  </div>
 
 
 
168
 
169
  </legend>
170
 
@@ -216,6 +217,9 @@
216
 
217
  <div id="sq_snippet_disclaimer" ><?php _e('If you don\'t see any changes in custom optimization, check if another SEO plugin affects Squirrly SEO', _SQ_PLUGIN_NAME_) ?></div>
218
  </div>
 
 
 
219
  </div>
220
  </fieldset>
221
  <fieldset id="sq_social_media" style="<?php echo ((SQ_Tools::$options['sq_use'] == 0) ? 'display:none;' : ''); ?>">
@@ -321,6 +325,11 @@
321
  </legend>
322
 
323
  <div>
 
 
 
 
 
324
  <ul id="sq_sitemap_option" class="sq_settings_info">
325
  <span><?php _e('XML Sitemap Options', _SQ_PLUGIN_NAME_); ?></span>
326
  <div class="sq_option_content sq_option_content_small">
@@ -493,9 +502,32 @@
493
  <input type="hidden" name="nonce" value="<?php echo wp_create_nonce(_SQ_NONCE_ID_); ?>" />
494
  <input type="submit" name="sq_update" value="<?php _e('Save SEO', _SQ_PLUGIN_NAME_) ?> &raquo;" />
495
  </div>
 
 
496
  </div>
497
  </form>
498
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
499
  </div>
500
 
501
  </div>
132
  <legend class="sq_legend_medium">
133
  <span class="sq_legend_title"><?php _e('First page optimization', _SQ_PLUGIN_NAME_); ?></span>
134
  <span><?php echo sprintf(__('%sThe best SEO approach to Meta information%s', _SQ_PLUGIN_NAME_), '<a href="http://www.squirrly.co/the-best-seo-approach-to-meta-information" target="_blank">', '</a>'); ?></span>
 
135
  <span><?php _e('Add meta <strong>title</strong> in Home Page', _SQ_PLUGIN_NAME_); ?></span>
136
  <?php
137
  $auto_option = false;
162
  <label for="sq_auto_description0" class="sq_switch-label sq_switch-label-on"><?php _e('No', _SQ_PLUGIN_NAME_); ?></label>
163
  <span class="sq_switch-selection"></span>
164
  </div>
 
165
  </div>
166
+ <span class="withborder"></span>
167
+ <span class="sq_legend_title"><?php _e('SEO for all post/pages', _SQ_PLUGIN_NAME_); ?></span>
168
+ <span><?php echo sprintf(__('To customize the Title and Description for all the Posts and Pages in your site use the %s<strong>Squirrly Snippet Tool</strong>%s', _SQ_PLUGIN_NAME_), '<a href="http://howto.squirrly.co/sides/squirrly-snippet-tool/" target="_blank" >', '</a>'); ?></span>
169
 
170
  </legend>
171
 
217
 
218
  <div id="sq_snippet_disclaimer" ><?php _e('If you don\'t see any changes in custom optimization, check if another SEO plugin affects Squirrly SEO', _SQ_PLUGIN_NAME_) ?></div>
219
  </div>
220
+ <br />
221
+ <span class="sq_option_info"><?php echo sprintf(__('To customize the Title and Description for all the Posts and Pages in your site use the %s<strong>Squirrly Snippet Tool</strong>%s while edit a Post/Page', _SQ_PLUGIN_NAME_), '<a href="http://howto.squirrly.co/sides/squirrly-snippet-tool/" target="_blank" >', '</a>'); ?></span>
222
+
223
  </div>
224
  </fieldset>
225
  <fieldset id="sq_social_media" style="<?php echo ((SQ_Tools::$options['sq_use'] == 0) ? 'display:none;' : ''); ?>">
325
  </legend>
326
 
327
  <div>
328
+ <?php
329
+ $auto_option = false;
330
+ if (SQ_Tools::$options['sq_sitemap_ping'] == 1)
331
+ $auto_option = true;
332
+ ?>
333
  <ul id="sq_sitemap_option" class="sq_settings_info">
334
  <span><?php _e('XML Sitemap Options', _SQ_PLUGIN_NAME_); ?></span>
335
  <div class="sq_option_content sq_option_content_small">
502
  <input type="hidden" name="nonce" value="<?php echo wp_create_nonce(_SQ_NONCE_ID_); ?>" />
503
  <input type="submit" name="sq_update" value="<?php _e('Save SEO', _SQ_PLUGIN_NAME_) ?> &raquo;" />
504
  </div>
505
+
506
+
507
  </div>
508
  </form>
509
 
510
+ <div class="sq_settings_backup">
511
+ <form action="" method="POST">
512
+ <input type="hidden" name="action" value="sq_backup" />
513
+ <input type="hidden" name="nonce" value="<?php echo wp_create_nonce(_SQ_NONCE_ID_); ?>" />
514
+ <input type="submit" class="sq_button" name="sq_backup" value="<?php _e('Backup Settings', _SQ_PLUGIN_NAME_) ?>" />
515
+ <input type="button" class="sq_button sq_restore" name="sq_restore" value="<?php _e('Restore Settings', _SQ_PLUGIN_NAME_) ?>" />
516
+ </form>
517
+ </div>
518
+
519
+ <div class="sq_settings_restore sq_popup" style="display: none">
520
+ <span class="sq_close">x</span>
521
+ <span><?php _e('Upload the file with the saved Squirrly Settings', _SQ_PLUGIN_NAME_) ?></span>
522
+ <form action="" method="POST" enctype="multipart/form-data">
523
+ <input type="hidden" name="action" value="sq_restore" />
524
+ <input type="file" name="sq_options" id="favicon" style="float: left;" />
525
+ <input type="hidden" name="nonce" value="<?php echo wp_create_nonce(_SQ_NONCE_ID_); ?>" />
526
+ <input type="submit" style="margin-top: 10px;" class="sq_button" name="sq_restore" value="<?php _e('Restore Backup', _SQ_PLUGIN_NAME_) ?>" />
527
+ </form>
528
+ </div>
529
+
530
+
531
  </div>
532
 
533
  </div>
themes/default/SQ_Blocklogin.php CHANGED
@@ -30,6 +30,7 @@
30
  </div>
31
 
32
  </div>
 
33
  <script type="text/javascript">
34
  // autoLogin();
35
  //
@@ -45,6 +46,20 @@
45
  //listenLogin(); //listen the login
46
  </script>
47
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  <div id="sq_login_success" style="display: none;">
49
  <div class="sq_header"><?php _e('Congratulations! You are ready to use all the features from Squirrly', _SQ_PLUGIN_NAME_); ?><div><img src="<?php echo _SQ_THEME_URL_ . 'img/settings/squirrly.png' ?>"></div></div>
50
 
30
  </div>
31
 
32
  </div>
33
+
34
  <script type="text/javascript">
35
  // autoLogin();
36
  //
46
  //listenLogin(); //listen the login
47
  </script>
48
  </div>
49
+ <div class="sq_settings_backup">
50
+ <input type="button" class="sq_button sq_restore" name="sq_restore" value="<?php _e('Restore Squirrly Settings', _SQ_PLUGIN_NAME_) ?>" />
51
+ </div>
52
+
53
+ <div class="sq_settings_restore sq_popup" style="display: none">
54
+ <span class="sq_close">x</span>
55
+ <span><?php _e('Upload the file with the saved Squirrly Settings', _SQ_PLUGIN_NAME_) ?></span>
56
+ <form action="#" method="POST" enctype="multipart/form-data">
57
+ <input type="hidden" name="action" value="sq_restore" />
58
+ <input type="file" name="sq_options" id="favicon" style="float: left;" />
59
+ <input type="hidden" name="nonce" value="<?php echo wp_create_nonce(_SQ_NONCE_ID_); ?>" />
60
+ <input type="submit" style="margin-top: 10px;" class="sq_button" name="sq_restore" value="<?php _e('Restore Backup', _SQ_PLUGIN_NAME_) ?>" />
61
+ </form>
62
+ </div>
63
  <div id="sq_login_success" style="display: none;">
64
  <div class="sq_header"><?php _e('Congratulations! You are ready to use all the features from Squirrly', _SQ_PLUGIN_NAME_); ?><div><img src="<?php echo _SQ_THEME_URL_ . 'img/settings/squirrly.png' ?>"></div></div>
65
 
themes/default/SQ_Blocksearch.php CHANGED
@@ -5,15 +5,14 @@
5
  <div class="sq_keyword">
6
  <?php
7
  global $sq_postID;
8
- if (!isset($_COOKIE['sq_keyword_' . $sq_postID]) || $_COOKIE['sq_keyword_' . $sq_postID] == '') {
9
- if (!isset(SQ_Tools::$options['sq_keyword_help']) || (int) SQ_Tools::$options['sq_keyword_help'] == 1) {
10
- ?>
11
- <div id="sq_keyword_help" style="display:none" ><span></span><?php _e('Enter a keyword', _SQ_PLUGIN_NAME_); ?><p><?php _e('for Squirrly Live SEO optimization', _SQ_PLUGIN_NAME_); ?></p></div>
12
- <?php
13
- }
14
  }
15
  ?>
16
- <input type="text" id="sq_keyword" name="sq_keyword" value="<?php echo ((isset($_COOKIE['sq_keyword_' . $sq_postID]) && $_COOKIE['sq_keyword_' . $sq_postID] <> '') ? utf8_decode($_COOKIE['sq_keyword_' . $sq_postID]) : '') ?>" autocomplete="off" />
17
 
18
  <input type="button" id="sq_keyword_check" value=">" />
19
  <div id="sq_suggestion" style="display:none">
5
  <div class="sq_keyword">
6
  <?php
7
  global $sq_postID;
8
+ $sq_keyword = '';
9
+ if (isset($sq_postID) && $json = SQ_ObjController::getModel('SQ_Post')->getKeyword($sq_postID)) {
10
+ $sq_keyword = SQ_Tools::i18n($json->keyword);
11
+ } elseif ((int) SQ_Tools::$options['sq_keyword_help'] == 1) {
12
+ ?><div id="sq_keyword_help" style="display:none" ><span></span><?php _e('Enter a keyword', _SQ_PLUGIN_NAME_); ?><p><?php _e('for Squirrly Live SEO optimization', _SQ_PLUGIN_NAME_); ?></p></div><?php
 
13
  }
14
  ?>
15
+ <input type="text" id="sq_keyword" name="sq_keyword" value="<?php echo $sq_keyword ?>" autocomplete="off" />
16
 
17
  <input type="button" id="sq_keyword_check" value=">" />
18
  <div id="sq_suggestion" style="display:none">
themes/default/css/sq_blockseo.css CHANGED
@@ -21,7 +21,7 @@
21
  progress.sq_blockseo_progress,
22
  progress.sq_blockseo_topprogress{
23
  width: 100%;;
24
- height: 3px;
25
  margin: 0;
26
  padding: 0;
27
  display: block;
21
  progress.sq_blockseo_progress,
22
  progress.sq_blockseo_topprogress{
23
  width: 100%;;
24
+ height: 4px;
25
  margin: 0;
26
  padding: 0;
27
  display: block;
themes/default/css/sq_global.css CHANGED
@@ -1,9 +1,11 @@
1
  .sq_message{
2
  line-height: 19px;
3
- padding: 0px 0;
 
 
4
  font-size: 13px;
5
  text-align: center;
6
- margin: -1px 15px 0 5px;
7
  border-width: 1px;
8
  border-style: solid;
9
  -webkit-border-bottom-right-radius: 3px;
@@ -18,28 +20,84 @@
18
  color: #555;
19
  }
20
  .sq_error{
21
- position: relative;
22
- width: auto !important;
23
  text-align: center;
24
  font-size: 14px;
25
  font-weight: bold;
26
  color: brown;
27
- margin: 5px 0 0 0;
28
- padding: 0 10px;
29
  }
30
 
31
  .sq_success{
32
  position: relative;
33
- width: auto !important;
 
34
  text-align: center;
35
  font-size: 16px;
36
  font-weight: bold;
37
  color: white;
38
- margin: 5px 0 0 0;
39
- padding: 10px;
 
40
  background-color: #20bc49;
41
  }
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  .sq_absolute{
44
  position: fixed;
45
  top: 28px;
1
  .sq_message{
2
  line-height: 19px;
3
+ width: calc(100% - 22px) !important;
4
+ margin: -1px 0;
5
+ padding: 0px;
6
  font-size: 13px;
7
  text-align: center;
8
+
9
  border-width: 1px;
10
  border-style: solid;
11
  -webkit-border-bottom-right-radius: 3px;
20
  color: #555;
21
  }
22
  .sq_error{
23
+ width: calc(100% - 22px) !important;
 
24
  text-align: center;
25
  font-size: 14px;
26
  font-weight: bold;
27
  color: brown;
28
+ margin: 32px 0 5px 0 !important;;
29
+ padding: 0 !important;
30
  }
31
 
32
  .sq_success{
33
  position: relative;
34
+ line-height: 30px;
35
+ width: calc(100% - 22px) !important;
36
  text-align: center;
37
  font-size: 16px;
38
  font-weight: bold;
39
  color: white;
40
+ margin: 32px 0 5px 0;
41
+ margin: 32px 0 5px 0 !important;;
42
+ padding: 0 !important;
43
  background-color: #20bc49;
44
  }
45
 
46
+ .sq_popup{
47
+ position: fixed;
48
+ padding: 20px !important;
49
+ margin: 0 !important;
50
+ top: calc(50% - 50px);
51
+ left: calc(50% - 200px);
52
+ width: 400px;
53
+ height: 100px;
54
+ background-color: #f9f9f9;
55
+ box-shadow: 0 0 38px 0 #333;
56
+ text-align: center;
57
+ z-index: 1000;
58
+ }
59
+
60
+ .sq_popup span{
61
+ line-height: 30px;
62
+ font-size: 100%;
63
+ font-weight: bold;
64
+ }
65
+
66
+ .sq_popup .sq_close{
67
+ position: absolute;
68
+ background-color: #e5d8cd;
69
+ right: -6px;
70
+ top: -9px;
71
+ font-size: 13px;
72
+ font-weight: bold;
73
+ color: #333;
74
+ width: 8px;
75
+ line-height: 16px;
76
+ padding: 2px 6px 3px;
77
+ border-radius: 10px;
78
+ -webkit-border-radius: 10px;
79
+ -moz-border-radius: 10px;
80
+ border: 1px solid darkOliveGreen;
81
+ cursor: pointer;
82
+ z-index: 2;
83
+ }
84
+
85
+ .squirrly_page_sq_seo .sq_error,
86
+ .squirrly_page_sq_seo .sq_success,
87
+ .toplevel_page_sq_dashboard .sq_error,
88
+ .toplevel_page_sq_dashboard .sq_success,
89
+ .squirrly_page_sq_settings .sq_error,
90
+ .squirrly_page_sq_settings .sq_success,
91
+ .squirrly_page_sq_account .sq_error,
92
+ .squirrly_page_sq_account .sq_success,
93
+ .squirrly_page_sq_affiliate .sq_error,
94
+ .squirrly_page_sq_affiliate .sq_success
95
+ .squirrly_page_sq_posts .sq_error,
96
+ .squirrly_page_sq_posts .sq_success
97
+ {
98
+ margin-top: 5px !important;
99
+ }
100
+
101
  .sq_absolute{
102
  position: fixed;
103
  top: 28px;
themes/default/css/sq_menu.css CHANGED
@@ -548,6 +548,42 @@
548
  color: white;
549
  }
550
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
551
  #sq_settings_body .customize,
552
  #sq_settings_body ._customize{
553
  font-size: 12px;
548
  color: white;
549
  }
550
 
551
+ .sq_settings_backup{
552
+ float: right;
553
+ margin-top: -30px;
554
+ }
555
+
556
+ #sq_settings_login .sq_settings_backup,
557
+ #postsquirrly .sq_settings_backup{
558
+ float: none;
559
+ margin: 0 auto;
560
+ width: 220px;
561
+ height: 33px;
562
+ }
563
+
564
+ .sq_settings_restore input[type=file]{
565
+ float:none !important;
566
+ }
567
+
568
+ .sq_settings_restore .sq_button{
569
+ background-color: lightslategray !important;
570
+ color: white !important;
571
+ }
572
+
573
+ .sq_settings_backup input.sq_button,
574
+ .sq_settings_restore input.sq_button{
575
+ font-size: 15px;
576
+ font-weight: bold;
577
+ line-height: 30px;
578
+ padding: 1px 10px;
579
+ margin-left: 11px;
580
+
581
+ background-color: lightslategray;
582
+ border: none;
583
+ color: white;
584
+ cursor: pointer;
585
+ }
586
+
587
  #sq_settings_body .customize,
588
  #sq_settings_body ._customize{
589
  font-size: 12px;
themes/default/js/sq_blocklogin.js CHANGED
@@ -53,7 +53,7 @@ function sq_blocklogin() {
53
  jQuery('#sq_login').attr("disabled", "disabled");
54
  jQuery('#sq_login').val('');
55
 
56
- jQuery.getJSON(
57
  sqQuery.ajaxurl,
58
  {
59
  action: 'sq_login',
@@ -61,21 +61,21 @@ function sq_blocklogin() {
61
  password: jQuery('#sq_password').val(),
62
  nonce: sqQuery.nonce
63
  }
64
- ).success(function (response) {
65
  if (typeof response.error !== 'undefined')
66
  if (response.error === 'invalid_token') {
67
 
68
- jQuery.getJSON(
69
  sqQuery.ajaxurl,
70
  {
71
  action: 'sq_reset',
72
  nonce: sqQuery.nonce
73
  }
74
- ).success(function (response) {
75
  if (typeof response.reset !== 'undefined')
76
  if (response.reset === 'success')
77
  location.reload();
78
- });
79
  }
80
  jQuery('#sq_login').removeAttr("disabled");
81
  jQuery('#sq_login').val('Login');
@@ -87,7 +87,7 @@ function sq_blocklogin() {
87
  if (typeof response.error !== 'undefined')
88
  jQuery('#sq_blocklogin').find('.sq_error').html(response.error);
89
 
90
- }).error(function (response) {
91
  if (response.status === 200 && response.responseText.indexOf('{') > 0) {
92
  response.responseText = response.responseText.substr(response.responseText.indexOf('{'), response.responseText.lastIndexOf('}'));
93
  try {
@@ -112,7 +112,7 @@ function sq_blocklogin() {
112
  jQuery('#sq_login').removeClass('sq_minloading');
113
  jQuery('#sq_blocklogin').find('.sq_error').html(__error_login);
114
  }
115
- });
116
  });
117
  }
118
 
@@ -129,14 +129,14 @@ function sq_autoLogin() {
129
  jQuery('#sq_blocklogin').find('.sq_message').hide();
130
 
131
 
132
- jQuery.getJSON(
133
  sqQuery.ajaxurl,
134
  {
135
  action: 'sq_register',
136
  email: jQuery('#sq_email').val(),
137
  nonce: sqQuery.nonce
138
  }
139
- ).success(function (response) {
140
 
141
  jQuery('#sq_register_wait').removeClass('sq_minloading');
142
  if (typeof response.token !== 'undefined') {
@@ -164,7 +164,7 @@ function sq_autoLogin() {
164
 
165
  }
166
 
167
- }).error(function (response) {
168
  if (response.status === 200 && response.responseText.indexOf('{') > 0) {
169
  response.responseText = response.responseText.substr(response.responseText.indexOf('{'), response.responseText.lastIndexOf('}'));
170
  try {
@@ -193,7 +193,7 @@ function sq_autoLogin() {
193
  jQuery('#sq_register_email').show();
194
  jQuery('#sq_register').html(__try_again);
195
  }
196
- });
197
  }
198
 
199
  function sq_reload(response) {
53
  jQuery('#sq_login').attr("disabled", "disabled");
54
  jQuery('#sq_login').val('');
55
 
56
+ jQuery.post(
57
  sqQuery.ajaxurl,
58
  {
59
  action: 'sq_login',
61
  password: jQuery('#sq_password').val(),
62
  nonce: sqQuery.nonce
63
  }
64
+ ).done(function (response) {
65
  if (typeof response.error !== 'undefined')
66
  if (response.error === 'invalid_token') {
67
 
68
+ jQuery.post(
69
  sqQuery.ajaxurl,
70
  {
71
  action: 'sq_reset',
72
  nonce: sqQuery.nonce
73
  }
74
+ ).done(function (response) {
75
  if (typeof response.reset !== 'undefined')
76
  if (response.reset === 'success')
77
  location.reload();
78
+ }, 'json');
79
  }
80
  jQuery('#sq_login').removeAttr("disabled");
81
  jQuery('#sq_login').val('Login');
87
  if (typeof response.error !== 'undefined')
88
  jQuery('#sq_blocklogin').find('.sq_error').html(response.error);
89
 
90
+ }).fail(function (response) {
91
  if (response.status === 200 && response.responseText.indexOf('{') > 0) {
92
  response.responseText = response.responseText.substr(response.responseText.indexOf('{'), response.responseText.lastIndexOf('}'));
93
  try {
112
  jQuery('#sq_login').removeClass('sq_minloading');
113
  jQuery('#sq_blocklogin').find('.sq_error').html(__error_login);
114
  }
115
+ }, 'json');
116
  });
117
  }
118
 
129
  jQuery('#sq_blocklogin').find('.sq_message').hide();
130
 
131
 
132
+ jQuery.post(
133
  sqQuery.ajaxurl,
134
  {
135
  action: 'sq_register',
136
  email: jQuery('#sq_email').val(),
137
  nonce: sqQuery.nonce
138
  }
139
+ ).done(function (response) {
140
 
141
  jQuery('#sq_register_wait').removeClass('sq_minloading');
142
  if (typeof response.token !== 'undefined') {
164
 
165
  }
166
 
167
+ }).fail(function (response) {
168
  if (response.status === 200 && response.responseText.indexOf('{') > 0) {
169
  response.responseText = response.responseText.substr(response.responseText.indexOf('{'), response.responseText.lastIndexOf('}'));
170
  try {
193
  jQuery('#sq_register_email').show();
194
  jQuery('#sq_register').html(__try_again);
195
  }
196
+ }, 'json');
197
  }
198
 
199
  function sq_reload(response) {
themes/default/js/sq_blocksettings.js CHANGED
@@ -29,7 +29,7 @@ function sq_submitSettings() {
29
  sq_post_types.push(jQuery(this).attr('value'));
30
  });
31
 
32
- jQuery.getJSON(
33
  sqQuery.ajaxurl,
34
  {
35
  action: 'sq_settings_update',
@@ -51,8 +51,8 @@ function sq_submitSettings() {
51
  // --
52
  nonce: sqQuery.nonce
53
  }
54
- ).success(function () {
55
  showSaved(2000);
56
- });
57
 
58
  }
29
  sq_post_types.push(jQuery(this).attr('value'));
30
  });
31
 
32
+ jQuery.post(
33
  sqQuery.ajaxurl,
34
  {
35
  action: 'sq_settings_update',
51
  // --
52
  nonce: sqQuery.nonce
53
  }
54
+ ).done(function () {
55
  showSaved(2000);
56
+ }, 'json');
57
 
58
  }
themes/default/js/sq_blocksettingsseo.js CHANGED
@@ -247,7 +247,7 @@ function sq_submitSettings() {
247
  sq_sitemap_show.push(jQuery(this).attr('value'));
248
  });
249
 
250
- jQuery.getJSON(
251
  sqQuery.ajaxurl,
252
  {
253
  action: 'sq_settingsseo_update',
@@ -294,9 +294,8 @@ function sq_submitSettings() {
294
 
295
  nonce: sqQuery.nonce
296
  }
297
- ).success(function () {
298
  showSaved(2000);
299
- });
300
- ;
301
 
302
  }
247
  sq_sitemap_show.push(jQuery(this).attr('value'));
248
  });
249
 
250
+ jQuery.post(
251
  sqQuery.ajaxurl,
252
  {
253
  action: 'sq_settingsseo_update',
294
 
295
  nonce: sqQuery.nonce
296
  }
297
+ ).done(function () {
298
  showSaved(2000);
299
+ }, 'json');
 
300
 
301
  }
themes/default/js/sq_blocksupport.js CHANGED
@@ -77,7 +77,7 @@ function sq_blocksupport() {
77
 
78
  document.cookie = "sq_feedback_face=" + jQuery("input[name=sq_feedback_face]:radio:checked").val() + "; expires=" + (60 * 12) + "; path=/";
79
 
80
- jQuery.getJSON(
81
  sqQuery.ajaxurl,
82
  {
83
  action: 'sq_feedback',
@@ -85,7 +85,7 @@ function sq_blocksupport() {
85
  message: jQuery("textarea[name=sq_feedback_message]").val(),
86
  nonce: sqQuery.nonce
87
  }
88
- ).success(function (response) {
89
  jQuery('#sq_feedback_submit').removeAttr("disabled");
90
  jQuery('#sq_feedback_submit').val('Send feedback');
91
  jQuery("textarea[name=sq_feedback_message]").val('');
@@ -97,7 +97,7 @@ function sq_blocksupport() {
97
 
98
 
99
 
100
- }).error(function (response) {
101
  if (response.status === 200 && response.responseText.indexOf('{') > 0) {
102
  response.responseText = response.responseText.substr(response.responseText.indexOf('{'), response.responseText.lastIndexOf('}'));
103
  try {
@@ -119,21 +119,21 @@ function sq_blocksupport() {
119
  jQuery('#sq_feedback_submit').removeClass('sq_minloading');
120
  jQuery('#sq_options_feedback_error').addClass('sq_error').removeClass('sq_message').html('Could not send the feedback');
121
  }
122
- });
123
  });
124
 
125
  jQuery("#sq_support_submit").bind('click', function () {
126
  jQuery('#sq_options_support_error').html('<p class="sq_minloading" style="margin:0 auto; padding:2px;"></p>');
127
  jQuery('#sq_support_submit').attr("disabled", "disabled");
128
 
129
- jQuery.getJSON(
130
  sqQuery.ajaxurl,
131
  {
132
  action: 'sq_support',
133
  message: jQuery("textarea[name=sq_support_message]").val(),
134
  nonce: sqQuery.nonce
135
  }
136
- ).success(function (response) {
137
  jQuery('#sq_support_submit').removeAttr("disabled");
138
  jQuery("textarea[name=sq_support_message]").val('');
139
 
@@ -144,7 +144,7 @@ function sq_blocksupport() {
144
 
145
 
146
 
147
- }).error(function (response) {
148
  if (response.status === 200 && response.responseText.indexOf('{') > 0) {
149
  response.responseText = response.responseText.substr(response.responseText.indexOf('{'), response.responseText.lastIndexOf('}'));
150
  try {
@@ -165,7 +165,7 @@ function sq_blocksupport() {
165
  jQuery('#sq_support_submit').removeClass('sq_minloading');
166
  jQuery('#sq_options_support_error').addClass('sq_error').removeClass('sq_message').html('Could not send the feedback');
167
  }
168
- });
169
  });
170
 
171
 
@@ -174,7 +174,7 @@ function sq_blocksupport() {
174
  jQuery('#sq_survey_error').html('<p class="sq_minloading" style="margin:0 auto; padding:2px;"></p>');
175
  jQuery('#sq_survey_submit').attr("disabled", "disabled");
176
 
177
- jQuery.getJSON(
178
  sqQuery.ajaxurl,
179
  {
180
  action: 'sq_support',
@@ -182,7 +182,7 @@ function sq_blocksupport() {
182
  message: jQuery("textarea[name=sq_survey_message]").val(),
183
  nonce: sqQuery.nonce
184
  }
185
- ).success(function (response) {
186
  jQuery('#sq_survey_submit').removeAttr("disabled");
187
  jQuery("textarea[name=sq_survey_message]").val('');
188
 
@@ -192,7 +192,7 @@ function sq_blocksupport() {
192
  jQuery('#sq_survey_error').removeClass('sq_error').html('');
193
 
194
  if (typeof response.success !== 'undefined') {
195
- jQuery.getJSON(
196
  sqQuery.ajaxurl,
197
  {
198
  action: 'sq_hide_survey',
@@ -202,7 +202,7 @@ function sq_blocksupport() {
202
  );
203
  }
204
 
205
- }).error(function (response) {
206
  if (response.status === 200 && response.responseText.indexOf('{') > 0) {
207
  response.responseText = response.responseText.substr(response.responseText.indexOf('{'), response.responseText.lastIndexOf('}'));
208
  try {
@@ -223,19 +223,19 @@ function sq_blocksupport() {
223
  jQuery('#sq_survey_submit').removeClass('sq_minloading');
224
  jQuery('#sq_survey_error').addClass('sq_error').removeClass('sq_message').html('Could not send your message');
225
  }
226
- });
227
  });
228
 
229
  jQuery("#sq_survey_close").bind('click', function () {
230
- jQuery.getJSON(
231
  sqQuery.ajaxurl,
232
  {
233
  action: 'sq_hide_survey',
234
  sq_hide_survey: '1',
235
  nonce: sqQuery.nonce
236
  }
237
- ).success(function () {
238
  jQuery('#sq_survey').hide();
239
- });
240
  });
241
  }
77
 
78
  document.cookie = "sq_feedback_face=" + jQuery("input[name=sq_feedback_face]:radio:checked").val() + "; expires=" + (60 * 12) + "; path=/";
79
 
80
+ jQuery.post(
81
  sqQuery.ajaxurl,
82
  {
83
  action: 'sq_feedback',
85
  message: jQuery("textarea[name=sq_feedback_message]").val(),
86
  nonce: sqQuery.nonce
87
  }
88
+ ).done(function (response) {
89
  jQuery('#sq_feedback_submit').removeAttr("disabled");
90
  jQuery('#sq_feedback_submit').val('Send feedback');
91
  jQuery("textarea[name=sq_feedback_message]").val('');
97
 
98
 
99
 
100
+ }).fail(function (response) {
101
  if (response.status === 200 && response.responseText.indexOf('{') > 0) {
102
  response.responseText = response.responseText.substr(response.responseText.indexOf('{'), response.responseText.lastIndexOf('}'));
103
  try {
119
  jQuery('#sq_feedback_submit').removeClass('sq_minloading');
120
  jQuery('#sq_options_feedback_error').addClass('sq_error').removeClass('sq_message').html('Could not send the feedback');
121
  }
122
+ }, 'json');
123
  });
124
 
125
  jQuery("#sq_support_submit").bind('click', function () {
126
  jQuery('#sq_options_support_error').html('<p class="sq_minloading" style="margin:0 auto; padding:2px;"></p>');
127
  jQuery('#sq_support_submit').attr("disabled", "disabled");
128
 
129
+ jQuery.post(
130
  sqQuery.ajaxurl,
131
  {
132
  action: 'sq_support',
133
  message: jQuery("textarea[name=sq_support_message]").val(),
134
  nonce: sqQuery.nonce
135
  }
136
+ ).done(function (response) {
137
  jQuery('#sq_support_submit').removeAttr("disabled");
138
  jQuery("textarea[name=sq_support_message]").val('');
139
 
144
 
145
 
146
 
147
+ }).fail(function (response) {
148
  if (response.status === 200 && response.responseText.indexOf('{') > 0) {
149
  response.responseText = response.responseText.substr(response.responseText.indexOf('{'), response.responseText.lastIndexOf('}'));
150
  try {
165
  jQuery('#sq_support_submit').removeClass('sq_minloading');
166
  jQuery('#sq_options_support_error').addClass('sq_error').removeClass('sq_message').html('Could not send the feedback');
167
  }
168
+ }, 'json');
169
  });
170
 
171
 
174
  jQuery('#sq_survey_error').html('<p class="sq_minloading" style="margin:0 auto; padding:2px;"></p>');
175
  jQuery('#sq_survey_submit').attr("disabled", "disabled");
176
 
177
+ jQuery.post(
178
  sqQuery.ajaxurl,
179
  {
180
  action: 'sq_support',
182
  message: jQuery("textarea[name=sq_survey_message]").val(),
183
  nonce: sqQuery.nonce
184
  }
185
+ ).done(function (response) {
186
  jQuery('#sq_survey_submit').removeAttr("disabled");
187
  jQuery("textarea[name=sq_survey_message]").val('');
188
 
192
  jQuery('#sq_survey_error').removeClass('sq_error').html('');
193
 
194
  if (typeof response.success !== 'undefined') {
195
+ jQuery.post(
196
  sqQuery.ajaxurl,
197
  {
198
  action: 'sq_hide_survey',
202
  );
203
  }
204
 
205
+ }).fail(function (response) {
206
  if (response.status === 200 && response.responseText.indexOf('{') > 0) {
207
  response.responseText = response.responseText.substr(response.responseText.indexOf('{'), response.responseText.lastIndexOf('}'));
208
  try {
223
  jQuery('#sq_survey_submit').removeClass('sq_minloading');
224
  jQuery('#sq_survey_error').addClass('sq_error').removeClass('sq_message').html('Could not send your message');
225
  }
226
+ }, 'json');
227
  });
228
 
229
  jQuery("#sq_survey_close").bind('click', function () {
230
+ jQuery.post(
231
  sqQuery.ajaxurl,
232
  {
233
  action: 'sq_hide_survey',
234
  sq_hide_survey: '1',
235
  nonce: sqQuery.nonce
236
  }
237
+ ).done(function () {
238
  jQuery('#sq_survey').hide();
239
+ }, 'json');
240
  });
241
  }
themes/default/js/sq_menu.js CHANGED
@@ -28,6 +28,15 @@ function sq_blockmenu() {
28
  jQuery('#sq_settings_form').submit();
29
  });
30
 
 
 
 
 
 
 
 
 
 
31
  //Go to settings listener
32
  jQuery("#sq_goto_seo").bind('click', function () {
33
  location.href = "?page=sq_seo";
@@ -120,20 +129,19 @@ function sq_getSnippet(url, show_url) {
120
  jQuery('#ogimage_preview').hide();
121
 
122
  setTimeout(function () {
123
- jQuery.getJSON(
124
  sqQuery.ajaxurl,
125
  {
126
  action: 'sq_get_snippet',
127
  url: url,
128
  nonce: sqQuery.nonce
129
  }
130
- ).success(function (response) {
131
  jQuery('#sq_snippet_ul').removeClass('sq_minloading');
132
  jQuery('#sq_snippet_update').show();
133
  jQuery('#sq_snippet_customize').show();
134
  jQuery('#sq_snippet_keywords').show();
135
  jQuery('#ogimage_preview').show();
136
-
137
  if (response) {
138
  jQuery('#sq_snippet_title').html(response.title);
139
  if (show_url !== '')
@@ -143,13 +151,10 @@ function sq_getSnippet(url, show_url) {
143
 
144
  jQuery('#sq_snippet_description').html(response.description);
145
  }
146
- }).error(function () {
147
- jQuery('#sq_snippet_ul').removeClass('sq_minloading');
148
- jQuery('#sq_snippet_update').show();
149
- }).complete(function () {
150
  jQuery('#sq_snippet_ul').removeClass('sq_minloading');
151
  jQuery('#sq_snippet_update').show();
152
- });
153
  }, 500);
154
  }
155
 
@@ -202,14 +207,14 @@ function sq_getUserStatus() {
202
  function sq_recheckRank(post_id) {
203
  jQuery('.sq_rank_column_button_recheck').hide();
204
  jQuery('#sq_rank_value' + post_id).html('').addClass('sq_loading');
205
- jQuery.getJSON(
206
  sqQuery.ajaxurl,
207
  {
208
  action: 'sq_recheck',
209
  post_id: post_id,
210
  nonce: sqQuery.nonce
211
  }
212
- ).success(function (response) {
213
  if (typeof response.rank !== 'undefined') {
214
  jQuery('#sq_rank_value' + post_id).html(response.rank).removeClass('sq_loading');
215
  } else {
@@ -220,10 +225,10 @@ function sq_recheckRank(post_id) {
220
  }, 10000)
221
 
222
 
223
- }).error(function () {
224
  jQuery('#sq_rank_value' + post_id).html('Error').removeClass('sq_loading');
225
  jQuery('.sq_rank_column_button_recheck').show();
226
- });
227
  }
228
 
229
  //Show user status in Squirrly > Account info
@@ -285,7 +290,7 @@ function sq_getHelp(category, zone) {
285
  active_help = '';
286
  }
287
 
288
- jQuery.getJSON(
289
  sqQuery.ajaxurl,
290
  {
291
  action: 'sq_active_help',
@@ -314,16 +319,16 @@ function sq_getHelp(category, zone) {
314
  function checkResponse(response) {
315
  if (typeof response.error !== 'undefined') {
316
  if (response.error === 'invalid_token') {
317
- jQuery.getJSON(
318
  sqQuery.ajaxurl,
319
  {
320
  action: 'sq_reset', nonce: sqQuery.nonce
321
  }
322
- ).success(function (response) {
323
  if (typeof response.reset !== 'undefined')
324
  if (response.reset === 'success')
325
  location.href = "?page=sq_dashboard";
326
- });
327
  }
328
  }
329
  }
@@ -342,4 +347,4 @@ function showSaved(time) {
342
 
343
  }, time);
344
  }
345
- }
28
  jQuery('#sq_settings_form').submit();
29
  });
30
 
31
+ jQuery('input[name=sq_restore]').bind('click', function () {
32
+ jQuery('.sq_settings_restore').show();
33
+ });
34
+
35
+ jQuery('.sq_settings_restore').find('.sq_close').bind('click', function () {
36
+ jQuery('.sq_settings_restore').find('textarea').val('');
37
+ jQuery('.sq_settings_restore').hide();
38
+ });
39
+
40
  //Go to settings listener
41
  jQuery("#sq_goto_seo").bind('click', function () {
42
  location.href = "?page=sq_seo";
129
  jQuery('#ogimage_preview').hide();
130
 
131
  setTimeout(function () {
132
+ jQuery.post(
133
  sqQuery.ajaxurl,
134
  {
135
  action: 'sq_get_snippet',
136
  url: url,
137
  nonce: sqQuery.nonce
138
  }
139
+ ).done(function (response) {
140
  jQuery('#sq_snippet_ul').removeClass('sq_minloading');
141
  jQuery('#sq_snippet_update').show();
142
  jQuery('#sq_snippet_customize').show();
143
  jQuery('#sq_snippet_keywords').show();
144
  jQuery('#ogimage_preview').show();
 
145
  if (response) {
146
  jQuery('#sq_snippet_title').html(response.title);
147
  if (show_url !== '')
151
 
152
  jQuery('#sq_snippet_description').html(response.description);
153
  }
154
+ }).fail(function () {
 
 
 
155
  jQuery('#sq_snippet_ul').removeClass('sq_minloading');
156
  jQuery('#sq_snippet_update').show();
157
+ }, 'json');
158
  }, 500);
159
  }
160
 
207
  function sq_recheckRank(post_id) {
208
  jQuery('.sq_rank_column_button_recheck').hide();
209
  jQuery('#sq_rank_value' + post_id).html('').addClass('sq_loading');
210
+ jQuery.post(
211
  sqQuery.ajaxurl,
212
  {
213
  action: 'sq_recheck',
214
  post_id: post_id,
215
  nonce: sqQuery.nonce
216
  }
217
+ ).done(function (response) {
218
  if (typeof response.rank !== 'undefined') {
219
  jQuery('#sq_rank_value' + post_id).html(response.rank).removeClass('sq_loading');
220
  } else {
225
  }, 10000)
226
 
227
 
228
+ }).fail(function () {
229
  jQuery('#sq_rank_value' + post_id).html('Error').removeClass('sq_loading');
230
  jQuery('.sq_rank_column_button_recheck').show();
231
+ }, 'json');
232
  }
233
 
234
  //Show user status in Squirrly > Account info
290
  active_help = '';
291
  }
292
 
293
+ jQuery.post(
294
  sqQuery.ajaxurl,
295
  {
296
  action: 'sq_active_help',
319
  function checkResponse(response) {
320
  if (typeof response.error !== 'undefined') {
321
  if (response.error === 'invalid_token') {
322
+ jQuery.post(
323
  sqQuery.ajaxurl,
324
  {
325
  action: 'sq_reset', nonce: sqQuery.nonce
326
  }
327
+ ).done(function (response) {
328
  if (typeof response.reset !== 'undefined')
329
  if (response.reset === 'success')
330
  location.href = "?page=sq_dashboard";
331
+ }, 'json');
332
  }
333
  }
334
  }
347
 
348
  }, time);
349
  }
350
+ }