SEO SQUIRRLY™ - Version 12.1.00

Version Description

Download this release

Release Info

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

Code changes from version 11.1.12 to 12.1.00

classes/ActionController.php CHANGED
@@ -123,7 +123,6 @@ class SQ_Classes_ActionController extends SQ_Classes_FrontController
123
  'description' => 'Post Page',
124
  'actions' => array(
125
  'action' => array(
126
- 'sq_create_demo',
127
  'sq_ajax_save_ogimage',
128
  'sq_ajax_get_post',
129
  'sq_ajax_save_post',
@@ -165,20 +164,21 @@ class SQ_Classes_ActionController extends SQ_Classes_FrontController
165
  'active' => '1',
166
  ),
167
  array(
168
- 'name' => 'SQ_Controllers_SeoSettings',
169
  'actions' => array(
170
  'action' => array(
171
  'sq_seosettings_automation',
172
- 'sq_seosettings_bulkseo',
173
- 'sq_seosettings_jsonld',
174
- 'sq_seosettings_metas',
175
- 'sq_seosettings_links',
176
- 'sq_seosettings_social',
177
- 'sq_seosettings_tracking',
178
- 'sq_seosettings_webmaster',
179
- 'sq_seosettings_sitemap',
180
- 'sq_seosettings_robots',
181
- 'sq_seosettings_favicon',
 
182
  'sq_seosettings_backupsettings',
183
  'sq_seosettings_backupseo',
184
  'sq_seosettings_restoresettings',
@@ -196,8 +196,6 @@ class SQ_Classes_ActionController extends SQ_Classes_FrontController
196
  'sq_rollback',
197
  'sq_alerts_close',
198
  'sq_ajax_seosettings_save',
199
- 'sq_ajax_automation_addpostype',
200
- 'sq_ajax_automation_deletepostype',
201
  'sq_ajax_sla_sticky',
202
  'sq_ajax_gsc_code',
203
  'sq_ajax_ga_code',
@@ -294,7 +292,7 @@ class SQ_Classes_ActionController extends SQ_Classes_FrontController
294
  'action' => array(
295
  'sq_onboarding_commitment',
296
  'sq_onboading_checksite',
297
- 'sq_onboarding_settings',
298
  ),
299
  ),
300
  'active' => '1',
@@ -350,9 +348,9 @@ class SQ_Classes_ActionController extends SQ_Classes_FrontController
350
  }
351
 
352
  $this->actions = array();
353
- $cur_action = SQ_Classes_Helpers_Tools::getValue('action', false);
354
- $http_referer = SQ_Classes_Helpers_Tools::getValue('_wp_http_referer', false);
355
- $sq_nonce = SQ_Classes_Helpers_Tools::getValue('sq_nonce', false);
356
 
357
  //Let only the logged users to access the actions
358
  if ($cur_action <> '' && $sq_nonce <> '') {
123
  'description' => 'Post Page',
124
  'actions' => array(
125
  'action' => array(
 
126
  'sq_ajax_save_ogimage',
127
  'sq_ajax_get_post',
128
  'sq_ajax_save_post',
164
  'active' => '1',
165
  ),
166
  array(
167
+ 'name' => 'SQ_Controllers_Automation',
168
  'actions' => array(
169
  'action' => array(
170
  'sq_seosettings_automation',
171
+ 'sq_automation_addpostype',
172
+ 'sq_ajax_automation_deletepostype',
173
+ ),
174
+ ),
175
+ 'active' => '1',
176
+ ),
177
+ array(
178
+ 'name' => 'SQ_Controllers_SeoSettings',
179
+ 'actions' => array(
180
+ 'action' => array(
181
+ 'sq_seosettings_save',
182
  'sq_seosettings_backupsettings',
183
  'sq_seosettings_backupseo',
184
  'sq_seosettings_restoresettings',
196
  'sq_rollback',
197
  'sq_alerts_close',
198
  'sq_ajax_seosettings_save',
 
 
199
  'sq_ajax_sla_sticky',
200
  'sq_ajax_gsc_code',
201
  'sq_ajax_ga_code',
292
  'action' => array(
293
  'sq_onboarding_commitment',
294
  'sq_onboading_checksite',
295
+ 'sq_onboarding_save',
296
  ),
297
  ),
298
  'active' => '1',
348
  }
349
 
350
  $this->actions = array();
351
+ $cur_action = SQ_Classes_Helpers_Tools::getValue('action');
352
+ $http_referer = SQ_Classes_Helpers_Tools::getValue('_wp_http_referer');
353
+ $sq_nonce = SQ_Classes_Helpers_Tools::getValue('sq_nonce');
354
 
355
  //Let only the logged users to access the actions
356
  if ($cur_action <> '' && $sq_nonce <> '') {
classes/DisplayController.php CHANGED
@@ -17,7 +17,7 @@ class SQ_Classes_DisplayController
17
  *
18
  * @return void
19
  */
20
- public static function loadMedia($uri = '', $params = array())
21
  {
22
  if (SQ_Classes_Helpers_Tools::isAjax()) {
23
  return;
@@ -105,7 +105,7 @@ class SQ_Classes_DisplayController
105
  * @param $view
106
  * @return bool|string
107
  */
108
- public function get_view($block, $view)
109
  {
110
 
111
  try {
@@ -124,4 +124,5 @@ class SQ_Classes_DisplayController
124
  }
125
 
126
 
 
127
  }
17
  *
18
  * @return void
19
  */
20
+ public static function loadMedia($uri = '', $params = array())
21
  {
22
  if (SQ_Classes_Helpers_Tools::isAjax()) {
23
  return;
105
  * @param $view
106
  * @return bool|string
107
  */
108
+ public function get_view($block, $view)
109
  {
110
 
111
  try {
124
  }
125
 
126
 
127
+
128
  }
classes/FrontController.php CHANGED
@@ -185,11 +185,4 @@ class SQ_Classes_FrontController
185
  {
186
  }
187
 
188
- /**
189
- * Show the notification bar
190
- */
191
- public function getNotificationBar()
192
- {
193
- $this->show_view('Blocks/VersionBar');
194
- }
195
  }
185
  {
186
  }
187
 
 
 
 
 
 
 
 
188
  }
classes/RemoteController.php CHANGED
@@ -1479,94 +1479,6 @@ class SQ_Classes_RemoteController
1479
 
1480
  }
1481
 
1482
- /**
1483
- * Load the JS for API
1484
- */
1485
- public static function loadJsVars()
1486
- {
1487
- global $post;
1488
- $referer = '';
1489
 
1490
- $metas = json_decode(wp_json_encode(SQ_Classes_Helpers_Tools::getOption('sq_metas')));
1491
- $sq_postID = (isset($post->ID) ? $post->ID : 0);
1492
-
1493
- //Load Squirrly Live Assistant for Elementor builder
1494
- if (SQ_Classes_Helpers_Tools::isPluginInstalled('elementor/elementor.php')) {
1495
- if (SQ_Classes_Helpers_Tools::getOption('sq_sla_frontend')) {
1496
- $referer = get_post_meta($sq_postID, '_sq_sla', true);
1497
- }
1498
- }
1499
-
1500
- echo '<script>
1501
- var SQ_DEBUG = ' . (int)SQ_DEBUG . ';
1502
- (function($){
1503
- $.sq_config = {
1504
- sq_use: ' . (int)SQ_Classes_Helpers_Tools::getOption('sq_use') . ',
1505
- sq_version: "' . esc_attr(SQ_VERSION) . '",
1506
- sq_sla_type: "' . esc_attr(SQ_Classes_Helpers_Tools::getOption('sq_sla_type')) . '",
1507
- token: "' . esc_attr(SQ_Classes_Helpers_Tools::getOption('sq_api')) . '",
1508
- url_token: "' . (SQ_Classes_Helpers_Tools::getOption('sq_cloud_connect') ? esc_attr(SQ_Classes_Helpers_Tools::getOption('sq_cloud_token')) : false) . '",
1509
- sq_baseurl: "' . esc_url(_SQ_STATIC_API_URL_) . '",
1510
- sq_uri: "' . esc_attr(SQ_URI) . '",
1511
- sq_apiurl: "' . esc_url(_SQ_APIV2_URL_) . '",
1512
- user_url: "' . esc_url(apply_filters('sq_homeurl', get_bloginfo('url'))) . '",
1513
- language: "' . esc_attr(apply_filters('sq_language', get_bloginfo('language'))) . '",
1514
- referer: "' . esc_attr($referer) . '",
1515
- sq_keywordtag: ' . (int)SQ_Classes_Helpers_Tools::getOption('sq_keywordtag') . ',
1516
- sq_keyword_help: ' . (int)SQ_Classes_Helpers_Tools::getOption('sq_keyword_help') . ',
1517
- frontend_css: "' . esc_url(_SQ_ASSETS_URL_ . 'css/frontend' . (SQ_DEBUG ? '' : '.min') . '.css') . '",
1518
- postID: "' . (int)$sq_postID . '",
1519
- prevNonce: "' . esc_attr(wp_create_nonce('post_preview_' . $sq_postID)) . '",
1520
- __keyword: "' . esc_html__('Keyword:', 'squirrly-seo') . '",
1521
- __date: "' . esc_html__('date', 'squirrly-seo') . '",
1522
- __noconnection: "' . esc_html__("To load the Live Assistant and optimize this page, click to connect to Squirrly Cloud.", 'squirrly-seo') . '",
1523
- __saved: "' . esc_html__('Saved!', 'squirrly-seo') . '",
1524
- __readit: "' . esc_html__('Read it!', 'squirrly-seo') . '",
1525
- __insertit: "' . esc_html__('Insert it!', 'squirrly-seo') . '",
1526
- __reference: "' . esc_html__('Reference', 'squirrly-seo') . '",
1527
- __insertasbox: "' . esc_html__('Insert as box', 'squirrly-seo') . '",
1528
- __addlink: "' . esc_html__('Insert Link', 'squirrly-seo') . '",
1529
- __notrelevant: "' . esc_html__('Not relevant?', 'squirrly-seo') . '",
1530
- __insertparagraph: "' . esc_html__('Insert in your article', 'squirrly-seo') . '",
1531
- __ajaxerror: "' . esc_html__(':( An error occurred while processing your request. Please try again', 'squirrly-seo') . '",
1532
- __nofound: "' . esc_html__('No results found!', 'squirrly-seo') . '",
1533
- __sq_photo_copyright: "' . esc_html__('[ ATTRIBUTE: Please check: %s to find out how to attribute this image ]', 'squirrly-seo') . '",
1534
- __has_attributes: "' . esc_html__('Has creative commons attributes', 'squirrly-seo') . '",
1535
- __no_attributes: "' . esc_html__('No known copyright restrictions', 'squirrly-seo') . '",
1536
- __noopt: "' . esc_html__('You haven`t used Squirrly SEO to optimize your article. Do you want to optimize for a keyword before publishing?', 'squirrly-seo') . '",
1537
- __subscription_expired: "' . esc_html__('Your Subscription has Expired', 'squirrly-seo') . '",
1538
- __no_briefcase: "' . esc_html__('There are no keywords saved in briefcase yet', 'squirrly-seo') . '",
1539
- __fulloptimized: "' . esc_html__('Congratulations! Your article is 100% optimized!', 'squirrly-seo') . '",
1540
- __toomanytimes: "' . esc_html__('appears too many times. Try to remove %s of them', 'squirrly-seo') . '",
1541
- __writemorewords: "' . esc_html__('write %s more words', 'squirrly-seo') . '",
1542
- __keywordinintroduction: "' . esc_html__('Add the keyword in the %s of your article', 'squirrly-seo') . '",
1543
- __clicktohighlight: "' . esc_html__('Click to keep the highlight on', 'squirrly-seo') . '",
1544
- __introduction: "' . esc_html__('introduction', 'squirrly-seo') . '",
1545
- __morewordsafter: "' . esc_html__('Write more words after the %s keyword', 'squirrly-seo') . '",
1546
- __orusesynonyms: "' . esc_html__('or use synonyms', 'squirrly-seo') . '",
1547
- __addmorewords: "' . esc_html__('add %s more word(s)', 'squirrly-seo') . '",
1548
- __removewords: "' . esc_html__('or remove %s word(s)', 'squirrly-seo') . '",
1549
- __addmorekeywords: "' . esc_html__('add the selected keyword %s more time(s) ', 'squirrly-seo') . '",
1550
- __addminimumwords: "' . esc_html__('write %s more words to start calculating', 'squirrly-seo') . '",
1551
- __add_to_briefcase: "' . esc_html__('Add to Briefcase', 'squirrly-seo') . '",
1552
- __add_keyword_briefcase: "' . esc_html__('Add Keyword to Briefcase', 'squirrly-seo') . '",
1553
- __usekeyword: "' . esc_html__('Select', 'squirrly-seo') . '",
1554
- __new_post_title: "' . esc_html__('Auto Draft') . '",
1555
- __enter_keyword: "' . esc_html__('Enter keyword above and press ENTER', 'squirrly-seo') . '",
1556
- __add_keyword: "' . esc_html__('Add Keywords from Briefcase', 'squirrly-seo') . '",
1557
- __frontend_optimized: "' . esc_html__('Live Assistant was used to optimize this page with the Page Builder. Please go back and resume your optimization work there.', 'squirrly-seo') . '",
1558
- };
1559
- $.sq_params = {
1560
- max_length_title: ' . (int)$metas->title_maxlength . ',
1561
- max_length_description: ' . (int)$metas->description_maxlength . ',
1562
- };
1563
-
1564
-
1565
- })(jQuery);
1566
- </script>';
1567
-
1568
- echo '<script src="' . esc_url(_SQ_STATIC_API_URL_ . SQ_URI . '/js/squirrly' . (SQ_DEBUG ? '' : '.min') . '.js?ver=' . SQ_VERSION) . '"></script>';
1569
-
1570
- }
1571
 
1572
  }
1479
 
1480
  }
1481
 
 
 
 
 
 
 
 
1482
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1483
 
1484
  }
classes/helpers/DevKit.php CHANGED
@@ -209,7 +209,7 @@ class SQ_Classes_Helpers_DevKit
209
  //Change the features
210
  public function manageFeatures($features)
211
  {
212
- if (!SQ_Classes_Helpers_Tools::getMenuVisible('show_panel')) {
213
  unset($features[0]); //remove the Cloud App features
214
  }
215
 
209
  //Change the features
210
  public function manageFeatures($features)
211
  {
212
+ if (!SQ_Classes_Helpers_Tools::getMenuVisible('show_account_info')) {
213
  unset($features[0]); //remove the Cloud App features
214
  }
215
 
classes/helpers/Sanitize.php CHANGED
@@ -10,7 +10,7 @@ class SQ_Classes_Helpers_Sanitize
10
  * @param $key
11
  * @return string|void
12
  */
13
- public static function escapeGetValue($key)
14
  {
15
  return esc_attr(SQ_Classes_Helpers_Tools::getValue($key));
16
  }
@@ -21,7 +21,7 @@ class SQ_Classes_Helpers_Sanitize
21
  * @param $title
22
  * @return mixed|null|string|string[]
23
  */
24
- public static function clearTitle($title)
25
  {
26
  if ($title <> '') {
27
  if (function_exists('preg_replace')) {
@@ -47,7 +47,7 @@ class SQ_Classes_Helpers_Sanitize
47
  * @param $description
48
  * @return null|string|string[]
49
  */
50
- public static function clearDescription($description)
51
  {
52
  if ($description <> '') {
53
  if (function_exists('preg_replace')) {
@@ -84,7 +84,7 @@ class SQ_Classes_Helpers_Sanitize
84
  * @param $keywords
85
  * @return mixed|null|string|string[]
86
  */
87
- public static function clearKeywords($keywords)
88
  {
89
  return self::clearTitle($keywords);
90
  }
@@ -98,7 +98,7 @@ class SQ_Classes_Helpers_Sanitize
98
  * @param string $for
99
  * @return string|void
100
  */
101
- public static function escapeKeyword($keyword, $for = 'all')
102
  {
103
  switch ($for){
104
  case 'url':
@@ -121,7 +121,7 @@ class SQ_Classes_Helpers_Sanitize
121
  * @param int $max
122
  * @return bool|mixed|null|string|string[]
123
  */
124
- public static function truncate($text, $min = 100, $max = 110)
125
  {
126
  //make sure they are values
127
  $max = (int)$max;
@@ -160,7 +160,7 @@ class SQ_Classes_Helpers_Sanitize
160
  * @param string $s
161
  * @return string
162
  */
163
- public static function normalizeChars($s)
164
  {
165
  $replace = array(
166
  'ъ'=>'-', 'Ь'=>'-', 'Ъ'=>'-', 'ь'=>'-',
@@ -207,13 +207,22 @@ class SQ_Classes_Helpers_Sanitize
207
  return strtr($s, $replace);
208
  }
209
 
 
 
 
 
 
 
 
 
 
210
  /**
211
  * Check the google code saved at settings
212
  *
213
  * @param string $code
214
  * @return string
215
  */
216
- public static function checkGoogleWTCode($code)
217
  {
218
  if ($code <> '') {
219
  $code = stripslashes($code);
@@ -237,7 +246,7 @@ class SQ_Classes_Helpers_Sanitize
237
  * @param string $code
238
  * @return string
239
  */
240
- public static function checkGoogleAnalyticsCode($code)
241
  {
242
  if ($code <> '') {
243
  $code = stripslashes($code);
@@ -266,7 +275,7 @@ class SQ_Classes_Helpers_Sanitize
266
  * @param string $code
267
  * @return string
268
  */
269
- public static function checkFacebookAdminCode($code)
270
  {
271
  if ($code <> '') {
272
  $code = trim($code);
@@ -304,7 +313,7 @@ class SQ_Classes_Helpers_Sanitize
304
  * @param string $code
305
  * @return string
306
  */
307
- public static function checkPinterestCode($code)
308
  {
309
  if ($code <> '') {
310
  $code = stripslashes($code);
@@ -329,7 +338,7 @@ class SQ_Classes_Helpers_Sanitize
329
  *
330
  * @return string
331
  */
332
- public static function checkBingWTCode($code)
333
  {
334
  if ($code <> '') {
335
  $code = stripslashes($code);
@@ -355,7 +364,7 @@ class SQ_Classes_Helpers_Sanitize
355
  *
356
  * @return string
357
  */
358
- public static function checkBaiduWTCode($code)
359
  {
360
  if ($code <> '') {
361
  $code = stripslashes($code);
@@ -381,7 +390,7 @@ class SQ_Classes_Helpers_Sanitize
381
  *
382
  * @return string
383
  */
384
- public static function checkYandexWTCode($code)
385
  {
386
  if ($code <> '') {
387
  $code = stripslashes($code);
@@ -407,7 +416,7 @@ class SQ_Classes_Helpers_Sanitize
407
  *
408
  * @return string
409
  */
410
- public static function checkAlexaCode($code)
411
  {
412
  if ($code <> '') {
413
  $code = stripslashes($code);
@@ -434,7 +443,7 @@ class SQ_Classes_Helpers_Sanitize
434
  * @param string $account
435
  * @return string
436
  */
437
- public static function checkTwitterAccount($account)
438
  {
439
  if ($account <> '' && strpos($account, '//') === false) {
440
  $account = 'https://twitter.com/' . $account;
@@ -449,7 +458,7 @@ class SQ_Classes_Helpers_Sanitize
449
  * @param string $account
450
  * @return string
451
  */
452
- public static function checkTwitterAccountName($account)
453
  {
454
  if ($account <> '' && strpos($account, '//') !== false) {
455
  $account = parse_url($account, PHP_URL_PATH);
@@ -470,7 +479,7 @@ class SQ_Classes_Helpers_Sanitize
470
  * @param string $account
471
  * @return string
472
  */
473
- public static function checkGoogleAccount($account)
474
  {
475
  if ($account <> '' && strpos($account, '//') === false) {
476
  $account = 'https://plus.google.com/' . $account;
@@ -484,7 +493,7 @@ class SQ_Classes_Helpers_Sanitize
484
  * @param string $account
485
  * @return string
486
  */
487
- public static function checkLinkeinAccount($account)
488
  {
489
  if ($account <> '' && strpos($account, '//') === false) {
490
  $account = 'https://www.linkedin.com/in/' . $account;
@@ -498,7 +507,7 @@ class SQ_Classes_Helpers_Sanitize
498
  * @param string $account
499
  * @return string
500
  */
501
- public static function checkFacebookAccount($account)
502
  {
503
  if ($account <> '' && strpos($account, '//') === false) {
504
  $account = 'https://www.facebook.com/' . $account;
@@ -512,7 +521,7 @@ class SQ_Classes_Helpers_Sanitize
512
  * @param $account
513
  * @return string
514
  */
515
- public static function checkPinterestAccount($account)
516
  {
517
  if ($account <> '' && strpos($account, '//') === false) {
518
  $account = 'https://www.pinterest.com/' . $account;
@@ -526,7 +535,7 @@ class SQ_Classes_Helpers_Sanitize
526
  * @param $account
527
  * @return string
528
  */
529
- public static function checkInstagramAccount($account)
530
  {
531
  if ($account <> '' && strpos($account, '//') === false) {
532
  $account = 'https://www.instagram.com/' . $account;
@@ -540,7 +549,7 @@ class SQ_Classes_Helpers_Sanitize
540
  * @param $account
541
  * @return string
542
  */
543
- public static function checkYoutubeAccount($account)
544
  {
545
  if ($account <> '' && strpos($account, '//') === false) {
546
  if (strpos($account, 'user/') === false && strpos($account, 'channel/') === false) {
@@ -555,7 +564,7 @@ class SQ_Classes_Helpers_Sanitize
555
  *
556
  * @return string
557
  */
558
- public static function checkFacebookPixel($code)
559
  {
560
  if ($code <> '') {
561
  if ((int)$code == 0) {
@@ -571,7 +580,7 @@ class SQ_Classes_Helpers_Sanitize
571
  *
572
  * @return string
573
  */
574
- public static function checkFacebookApp($code)
575
  {
576
  if ($code <> '') {
577
  if ((int)$code == 0) {
@@ -588,7 +597,7 @@ class SQ_Classes_Helpers_Sanitize
588
  * @param string $in
589
  * @return string $in localized
590
  */
591
- public static function i18n($in)
592
  {
593
  if (function_exists('langswitch_filter_langs_with_message')) {
594
  $in = langswitch_filter_langs_with_message($in);
10
  * @param $key
11
  * @return string|void
12
  */
13
+ public static function escapeGetValue($key)
14
  {
15
  return esc_attr(SQ_Classes_Helpers_Tools::getValue($key));
16
  }
21
  * @param $title
22
  * @return mixed|null|string|string[]
23
  */
24
+ public static function clearTitle($title)
25
  {
26
  if ($title <> '') {
27
  if (function_exists('preg_replace')) {
47
  * @param $description
48
  * @return null|string|string[]
49
  */
50
+ public static function clearDescription($description)
51
  {
52
  if ($description <> '') {
53
  if (function_exists('preg_replace')) {
84
  * @param $keywords
85
  * @return mixed|null|string|string[]
86
  */
87
+ public static function clearKeywords($keywords)
88
  {
89
  return self::clearTitle($keywords);
90
  }
98
  * @param string $for
99
  * @return string|void
100
  */
101
+ public static function escapeKeyword($keyword, $for = 'all')
102
  {
103
  switch ($for){
104
  case 'url':
121
  * @param int $max
122
  * @return bool|mixed|null|string|string[]
123
  */
124
+ public static function truncate($text, $min = 100, $max = 110)
125
  {
126
  //make sure they are values
127
  $max = (int)$max;
160
  * @param string $s
161
  * @return string
162
  */
163
+ public static function normalizeChars($s)
164
  {
165
  $replace = array(
166
  'ъ'=>'-', 'Ь'=>'-', 'Ъ'=>'-', 'ь'=>'-',
207
  return strtr($s, $replace);
208
  }
209
 
210
+ public static function checkTelephone($phone)
211
+ {
212
+ if ($phone <> '') {
213
+ $phone = '+' . ltrim($phone, '+');
214
+ }
215
+
216
+ return $phone;
217
+ }
218
+
219
  /**
220
  * Check the google code saved at settings
221
  *
222
  * @param string $code
223
  * @return string
224
  */
225
+ public static function checkGoogleWTCode($code)
226
  {
227
  if ($code <> '') {
228
  $code = stripslashes($code);
246
  * @param string $code
247
  * @return string
248
  */
249
+ public static function checkGoogleAnalyticsCode($code)
250
  {
251
  if ($code <> '') {
252
  $code = stripslashes($code);
275
  * @param string $code
276
  * @return string
277
  */
278
+ public static function checkFacebookAdminCode($code)
279
  {
280
  if ($code <> '') {
281
  $code = trim($code);
313
  * @param string $code
314
  * @return string
315
  */
316
+ public static function checkPinterestCode($code)
317
  {
318
  if ($code <> '') {
319
  $code = stripslashes($code);
338
  *
339
  * @return string
340
  */
341
+ public static function checkBingWTCode($code)
342
  {
343
  if ($code <> '') {
344
  $code = stripslashes($code);
364
  *
365
  * @return string
366
  */
367
+ public static function checkBaiduWTCode($code)
368
  {
369
  if ($code <> '') {
370
  $code = stripslashes($code);
390
  *
391
  * @return string
392
  */
393
+ public static function checkYandexWTCode($code)
394
  {
395
  if ($code <> '') {
396
  $code = stripslashes($code);
416
  *
417
  * @return string
418
  */
419
+ public static function checkAlexaCode($code)
420
  {
421
  if ($code <> '') {
422
  $code = stripslashes($code);
443
  * @param string $account
444
  * @return string
445
  */
446
+ public static function checkTwitterAccount($account)
447
  {
448
  if ($account <> '' && strpos($account, '//') === false) {
449
  $account = 'https://twitter.com/' . $account;
458
  * @param string $account
459
  * @return string
460
  */
461
+ public static function checkTwitterAccountName($account)
462
  {
463
  if ($account <> '' && strpos($account, '//') !== false) {
464
  $account = parse_url($account, PHP_URL_PATH);
479
  * @param string $account
480
  * @return string
481
  */
482
+ public static function checkGoogleAccount($account)
483
  {
484
  if ($account <> '' && strpos($account, '//') === false) {
485
  $account = 'https://plus.google.com/' . $account;
493
  * @param string $account
494
  * @return string
495
  */
496
+ public static function checkLinkeinAccount($account)
497
  {
498
  if ($account <> '' && strpos($account, '//') === false) {
499
  $account = 'https://www.linkedin.com/in/' . $account;
507
  * @param string $account
508
  * @return string
509
  */
510
+ public static function checkFacebookAccount($account)
511
  {
512
  if ($account <> '' && strpos($account, '//') === false) {
513
  $account = 'https://www.facebook.com/' . $account;
521
  * @param $account
522
  * @return string
523
  */
524
+ public static function checkPinterestAccount($account)
525
  {
526
  if ($account <> '' && strpos($account, '//') === false) {
527
  $account = 'https://www.pinterest.com/' . $account;
535
  * @param $account
536
  * @return string
537
  */
538
+ public static function checkInstagramAccount($account)
539
  {
540
  if ($account <> '' && strpos($account, '//') === false) {
541
  $account = 'https://www.instagram.com/' . $account;
549
  * @param $account
550
  * @return string
551
  */
552
+ public static function checkYoutubeAccount($account)
553
  {
554
  if ($account <> '' && strpos($account, '//') === false) {
555
  if (strpos($account, 'user/') === false && strpos($account, 'channel/') === false) {
564
  *
565
  * @return string
566
  */
567
+ public static function checkFacebookPixel($code)
568
  {
569
  if ($code <> '') {
570
  if ((int)$code == 0) {
580
  *
581
  * @return string
582
  */
583
+ public static function checkFacebookApp($code)
584
  {
585
  if ($code <> '') {
586
  if ((int)$code == 0) {
597
  * @param string $in
598
  * @return string $in localized
599
  */
600
+ public static function i18n($in)
601
  {
602
  if (function_exists('langswitch_filter_langs_with_message')) {
603
  $in = langswitch_filter_langs_with_message($in);
classes/helpers/Tools.php CHANGED
@@ -111,7 +111,7 @@ class SQ_Classes_Helpers_Tools
111
  .ml-stars svg:hover ~ svg{fill:none}
112
  </style>';
113
 
114
- $meta[] = "<a href='https://howto.squirrly.co/wordpress-seo/' target='_blank'>" . esc_html__("Documentation", 'squirrly-seo') . "</a>";
115
  $meta[] = "<a href='https://wordpress.org/support/plugin/squirrly-seo/reviews/#new-post' target='_blank' title='" . esc_html__("Leave a review", 'squirrly-seo') . "'><i class='ml-stars'><svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg><svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg><svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg><svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg><svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg></i></a>";
116
  }
117
  return $meta;
@@ -120,7 +120,7 @@ class SQ_Classes_Helpers_Tools
120
  /**
121
  * Load the Options from user option table in DB
122
  *
123
- * @param string $action
124
  * @return array|mixed|object
125
  */
126
  public static function getOptions($action = '')
@@ -156,30 +156,32 @@ class SQ_Classes_Helpers_Tools
156
  'sq_complete_uninstall' => 0,
157
 
158
  //Onboarding
 
159
  'sq_onboarding' => 0,
160
  'sq_onboarding_data' => array(),
161
 
162
  //Live Assistant
163
  'sq_sla' => 1,
164
- 'sq_sla_frontend' => 1,
165
  'sq_sla_type' => 'auto',
166
  'sq_sla_exclude_post_types' => array(),
167
  'sq_keyword_help' => 1,
168
  'sq_local_images' => 0,
169
  'sq_img_licence' => 1,
170
- 'sq_sla_social_fetch' => 1,
171
 
172
  //JsonLD
173
- 'sq_auto_jsonld' => 1,
174
  'sq_auto_jsonld_local' => 0,
175
  'sq_jsonld_type' => 'Organization',
 
176
  'sq_jsonld_global_person' => 0,
177
  'sq_jsonld_breadcrumbs' => 1,
178
  'sq_jsonld_woocommerce' => 1,
179
  'sq_jsonld_clearcode' => 0,
180
  'sq_jsonld_product_rating' => 0,
181
  'sq_jsonld_product_custom' => 1,
182
- 'sq_jsonld_product_defaults' => 1,
183
  'sq_jsonld_local' => array(
184
  'priceRange' => '',
185
  'servesCuisine' => '',
@@ -275,7 +277,7 @@ class SQ_Classes_Helpers_Tools
275
  )),
276
 
277
  //Sitemap
278
- 'sq_auto_sitemap' => 1,
279
  'sq_sitemap_ping' => 0,
280
  'sq_sitemap_exclude_noindex' => 0,
281
  'sq_sitemap_show' => array(
@@ -302,7 +304,7 @@ class SQ_Classes_Helpers_Tools
302
  ),
303
 
304
  //Robots
305
- 'sq_auto_robots' => 1,
306
  'sq_robots_permission' => array(
307
  'User-agent: *',
308
  'Disallow: */trackback/',
@@ -314,7 +316,7 @@ class SQ_Classes_Helpers_Tools
314
 
315
  //Metas
316
  'sq_use' => 1,
317
- 'sq_auto_metas' => 1,
318
  'sq_auto_links' => 0,
319
  'sq_auto_redirects' => 1,
320
  'sq_auto_title' => 1,
@@ -325,7 +327,7 @@ class SQ_Classes_Helpers_Tools
325
  'sq_auto_dublincore' => 0,
326
  'sq_auto_feed' => 0,
327
  'sq_auto_noindex' => 1,
328
- 'sq_use_frontend' => 1,
329
  'sq_attachment_redirect' => 0,
330
  'sq_term_noindex_empty' => 1,
331
  '404_url_redirect' => home_url(),
@@ -368,23 +370,25 @@ class SQ_Classes_Helpers_Tools
368
  //menu restrictions
369
  'menu' => array(
370
  'show_account_info' => 1,
 
 
 
371
  'show_journey' => 1,
372
- 'show_panel' => 1,
373
- 'show_tutorial' => 1,
374
- 'show_audit' => 1,
375
  'show_assistant' => 1,
 
376
  'show_bulkseo' => 1,
377
- 'show_research' => 1,
378
- 'show_rankings' => 1,
379
  'show_focuspages' => 1,
380
- 'show_seogoals' => 1,
 
 
 
381
  'show_ads' => 1,
382
  ),
383
 
384
  //socials
385
- 'sq_auto_social' => 1,
386
- 'sq_auto_facebook' => 1,
387
- 'sq_auto_twitter' => 1,
388
  'sq_og_locale' => 'en_US',
389
  'sq_og_image' => '',
390
  'sq_tc_image' => '',
@@ -407,12 +411,12 @@ class SQ_Classes_Helpers_Tools
407
  ),
408
 
409
  //Webmasters and Tracking
410
- 'sq_auto_amp' => 1,
411
- 'sq_auto_tracking' => 1,
412
- 'sq_auto_pixels' => 1,
413
- 'sq_tracking_logged_users' => 1,
414
  'sq_tracking_ip_users' => 1,
415
- 'sq_auto_webmasters' => 1,
416
  'sq_analytics_google_js' => 'analytics',
417
  'codes' => array(
418
  'google_wt' => "",
@@ -428,7 +432,7 @@ class SQ_Classes_Helpers_Tools
428
  ),
429
 
430
  //Patterns
431
- 'sq_auto_pattern' => 1,
432
  'patterns' => array(
433
  'home' => array(
434
  'protected' => 1,
@@ -795,6 +799,67 @@ class SQ_Classes_Helpers_Tools
795
  );
796
  $options = json_decode(get_option(SQ_OPTION), true);
797
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
798
  //Update the Json-LD for Organization Logo
799
  if (isset($options['sq_jsonld']['Organization']['logo']) && !is_array($options['sq_jsonld']['Organization']['logo'])) {
800
  $options['sq_jsonld']['Organization']['logo'] = array(
@@ -823,18 +888,6 @@ class SQ_Classes_Helpers_Tools
823
 
824
  unset($options['sq_jsonld']['Person']['logo']);
825
  }
826
-
827
- if ($action == 'reset') {
828
- $init['sq_api'] = $options['sq_api'];
829
- return $init;
830
- }
831
-
832
- if (is_array($options)) {
833
- $options = array_replace_recursive((array)$default, (array)$options);
834
- return $options;
835
- }
836
-
837
- return $default;
838
  }
839
 
840
  /**
@@ -1064,9 +1117,7 @@ class SQ_Classes_Helpers_Tools
1064
  }
1065
  } elseif (is_string($ret) && $ret <> '' && $keep_newlines && function_exists('sanitize_textarea_field')) {
1066
  $ret = sanitize_textarea_field($ret);
1067
- } elseif (is_numeric($ret)) {
1068
- $ret = (int) $ret;
1069
- } else{
1070
  $ret = sanitize_text_field($ret);
1071
  }
1072
 
@@ -1119,6 +1170,16 @@ class SQ_Classes_Helpers_Tools
1119
  }
1120
  }
1121
 
 
 
 
 
 
 
 
 
 
 
1122
  /**
1123
  * Load the multilanguage support from .mo
1124
  */
111
  .ml-stars svg:hover ~ svg{fill:none}
112
  </style>';
113
 
114
+ $meta[] = "<a href='https://howto12.squirrly.co/wordpress-seo/' target='_blank'>" . esc_html__("Documentation", 'squirrly-seo') . "</a>";
115
  $meta[] = "<a href='https://wordpress.org/support/plugin/squirrly-seo/reviews/#new-post' target='_blank' title='" . esc_html__("Leave a review", 'squirrly-seo') . "'><i class='ml-stars'><svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg><svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg><svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg><svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg><svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg></i></a>";
116
  }
117
  return $meta;
120
  /**
121
  * Load the Options from user option table in DB
122
  *
123
+ * @param string $action
124
  * @return array|mixed|object
125
  */
126
  public static function getOptions($action = '')
156
  'sq_complete_uninstall' => 0,
157
 
158
  //Onboarding
159
+ 'sq_mode' => 0,
160
  'sq_onboarding' => 0,
161
  'sq_onboarding_data' => array(),
162
 
163
  //Live Assistant
164
  'sq_sla' => 1,
165
+ 'sq_sla_frontend' => 0,
166
  'sq_sla_type' => 'auto',
167
  'sq_sla_exclude_post_types' => array(),
168
  'sq_keyword_help' => 1,
169
  'sq_local_images' => 0,
170
  'sq_img_licence' => 1,
171
+ 'sq_sla_social_fetch' => 0,
172
 
173
  //JsonLD
174
+ 'sq_auto_jsonld' => 0,
175
  'sq_auto_jsonld_local' => 0,
176
  'sq_jsonld_type' => 'Organization',
177
+ 'sq_jsonld_personal' => 0,
178
  'sq_jsonld_global_person' => 0,
179
  'sq_jsonld_breadcrumbs' => 1,
180
  'sq_jsonld_woocommerce' => 1,
181
  'sq_jsonld_clearcode' => 0,
182
  'sq_jsonld_product_rating' => 0,
183
  'sq_jsonld_product_custom' => 1,
184
+ 'sq_jsonld_product_defaults' => 0,
185
  'sq_jsonld_local' => array(
186
  'priceRange' => '',
187
  'servesCuisine' => '',
277
  )),
278
 
279
  //Sitemap
280
+ 'sq_auto_sitemap' => 0,
281
  'sq_sitemap_ping' => 0,
282
  'sq_sitemap_exclude_noindex' => 0,
283
  'sq_sitemap_show' => array(
304
  ),
305
 
306
  //Robots
307
+ 'sq_auto_robots' => 0,
308
  'sq_robots_permission' => array(
309
  'User-agent: *',
310
  'Disallow: */trackback/',
316
 
317
  //Metas
318
  'sq_use' => 1,
319
+ 'sq_auto_metas' => 0,
320
  'sq_auto_links' => 0,
321
  'sq_auto_redirects' => 1,
322
  'sq_auto_title' => 1,
327
  'sq_auto_dublincore' => 0,
328
  'sq_auto_feed' => 0,
329
  'sq_auto_noindex' => 1,
330
+ 'sq_use_frontend' => 0,
331
  'sq_attachment_redirect' => 0,
332
  'sq_term_noindex_empty' => 1,
333
  '404_url_redirect' => home_url(),
370
  //menu restrictions
371
  'menu' => array(
372
  'show_account_info' => 1,
373
+ 'show_seogoals' => 1,
374
+ 'show_features' => 1,
375
+ 'show_onpagesetup' => 1,
376
  'show_journey' => 1,
377
+ 'show_research' => 1,
 
 
378
  'show_assistant' => 1,
379
+ 'show_automation' => 1,
380
  'show_bulkseo' => 1,
 
 
381
  'show_focuspages' => 1,
382
+ 'show_audit' => 1,
383
+ 'show_rankings' => 1,
384
+ 'show_tutorial' => 1,
385
+ 'show_seo' => 1,
386
  'show_ads' => 1,
387
  ),
388
 
389
  //socials
390
+ 'sq_auto_facebook' => 0,
391
+ 'sq_auto_twitter' => 0,
 
392
  'sq_og_locale' => 'en_US',
393
  'sq_og_image' => '',
394
  'sq_tc_image' => '',
411
  ),
412
 
413
  //Webmasters and Tracking
414
+ 'sq_auto_amp' => 0,
415
+ 'sq_auto_tracking' => 0,
416
+ 'sq_auto_pixels' => 0,
417
+ 'sq_tracking_logged_users' => 0,
418
  'sq_tracking_ip_users' => 1,
419
+ 'sq_auto_webmasters' => 0,
420
  'sq_analytics_google_js' => 'analytics',
421
  'codes' => array(
422
  'google_wt' => "",
432
  ),
433
 
434
  //Patterns
435
+ 'sq_auto_pattern' => 0,
436
  'patterns' => array(
437
  'home' => array(
438
  'protected' => 1,
799
  );
800
  $options = json_decode(get_option(SQ_OPTION), true);
801
 
802
+ //Check the updates from old versions of the plugin
803
+ self::checkUpdates();
804
+
805
+
806
+
807
+ //Replace the default options with the database data
808
+ if (is_array($options)) {
809
+ $options = array_replace_recursive((array)$default, (array)$options);
810
+
811
+ //Add recommended settings
812
+ if ($action == 'reset') {
813
+ $options['sq_auto_jsonld'] = 0;
814
+ $options['sq_auto_sitemap'] = 0;
815
+ $options['sq_sitemap_exclude_noindex'] = 0;
816
+ $options['sq_sitemap_ping'] = 0;
817
+ $options['sq_attachment_redirect'] = 0;
818
+ $options['sq_auto_metas'] = 0;
819
+ $options['sq_auto_amp'] = 0;
820
+ $options['sq_auto_robots'] = 0;
821
+ $options['sq_auto_facebook'] = 0;
822
+ $options['sq_sla_social_fetch'] = 0;
823
+ $options['sq_auto_twitter'] = 0;
824
+ $options['sq_auto_tracking'] = 0;
825
+ $options['sq_auto_pixels'] = 0;
826
+ $options['sq_auto_webmasters'] = 0;
827
+ $options['sq_auto_pattern'] = 0;
828
+ $options['sq_use_frontend'] = 0;
829
+ $options['sq_auto_favicon'] = 0;
830
+ }
831
+
832
+ //Add recommended settings
833
+ if ($action == 'recommended') {
834
+ $options['sq_auto_jsonld'] = 1;
835
+ $options['sq_auto_sitemap'] = 1;
836
+ $options['sq_sitemap_exclude_noindex'] = 1;
837
+ $options['sq_sitemap_ping'] = 1;
838
+ $options['sq_attachment_redirect'] = 1;
839
+ $options['sq_auto_metas'] = 1;
840
+ $options['sq_auto_amp'] = 1;
841
+ $options['sq_auto_robots'] = 1;
842
+ $options['sq_auto_facebook'] = 1;
843
+ $options['sq_sla_social_fetch'] = 1;
844
+ $options['sq_auto_twitter'] = 1;
845
+ $options['sq_auto_tracking'] = 1;
846
+ $options['sq_auto_pixels'] = 1;
847
+ $options['sq_auto_webmasters'] = 1;
848
+ $options['sq_auto_pattern'] = 1;
849
+ $options['sq_use_frontend'] = 1;
850
+ }
851
+
852
+ return $options;
853
+ }
854
+
855
+ return $default;
856
+ }
857
+
858
+ /**
859
+ * Check the updates
860
+ * @return void
861
+ */
862
+ public static function checkUpdates(){
863
  //Update the Json-LD for Organization Logo
864
  if (isset($options['sq_jsonld']['Organization']['logo']) && !is_array($options['sq_jsonld']['Organization']['logo'])) {
865
  $options['sq_jsonld']['Organization']['logo'] = array(
888
 
889
  unset($options['sq_jsonld']['Person']['logo']);
890
  }
 
 
 
 
 
 
 
 
 
 
 
 
891
  }
892
 
893
  /**
1117
  }
1118
  } elseif (is_string($ret) && $ret <> '' && $keep_newlines && function_exists('sanitize_textarea_field')) {
1119
  $ret = sanitize_textarea_field($ret);
1120
+ } else{
 
 
1121
  $ret = sanitize_text_field($ret);
1122
  }
1123
 
1170
  }
1171
  }
1172
 
1173
+ /**
1174
+ * Get the first key of the given array without affecting
1175
+ * the internal array pointer
1176
+ */
1177
+ public static function arrayKeyFirst( array $arr ) {
1178
+ foreach ( $arr as $key => $value ) {
1179
+ return $key;
1180
+ }
1181
+ }
1182
+
1183
  /**
1184
  * Load the multilanguage support from .mo
1185
  */
config.json DELETED
@@ -1,299 +0,0 @@
1
- {
2
- "blocks": {
3
- "block": [
4
- {
5
- "name": "SQ_Core_Blocklogin",
6
- "description": "Connection Block",
7
- "actions": {
8
- "action": [
9
- "sq_login",
10
- "sq_register"
11
- ]
12
- },
13
- "active": "1",
14
- "admin": "1"
15
- },
16
- {
17
- "name": "SQ_Core_BlockConnect",
18
- "description": "Connection Block to API",
19
- "actions": {
20
- "action": [
21
- "sq_cloud_connect",
22
- "sq_cloud_disconnect"
23
- ]
24
- },
25
- "active": "1",
26
- "admin": "1"
27
- },
28
- {
29
- "name": "SQ_Controllers_Account",
30
- "description": "Account Class",
31
- "actions": {
32
- "action": [
33
- "sq_ajax_account_getaccount"
34
- ]
35
- },
36
- "active": "1",
37
- "admin": "1"
38
- },
39
- {
40
- "name": "SQ_Controllers_FocusPages",
41
- "description": "Focus Pages Controller",
42
- "actions": {
43
- "action": [
44
- "sq_focuspages_getpage",
45
- "sq_focuspages_addnew",
46
- "sq_focuspages_update",
47
- "sq_focuspages_delete",
48
- "sq_focuspages_inspecturl"
49
- ]
50
- },
51
- "active": "1",
52
- "admin": "1"
53
- },
54
- {
55
- "name": "SQ_Controllers_PostsList",
56
- "description": "Posts List Page",
57
- "actions": {
58
- "action": [
59
- "inline-save",
60
- "sq_ajax_postslist"
61
- ]
62
- },
63
- "active": "1",
64
- "admin": "1"
65
- },
66
- {
67
- "name": "SQ_Controllers_Post",
68
- "description": "Post Page",
69
- "actions": {
70
- "action": [
71
- "sq_create_demo",
72
- "sq_ajax_save_ogimage",
73
- "sq_ajax_get_post",
74
- "sq_ajax_save_post",
75
- "sq_ajax_type_click",
76
- "sq_ajax_search_blog"
77
- ]
78
- },
79
- "active": "1",
80
- "admin": "1"
81
- },
82
- {
83
- "name": "SQ_Controllers_Snippet",
84
- "description": "Snippet Page",
85
- "actions": {
86
- "action": [
87
- "sq_saveseo",
88
- "sq_getsnippet",
89
- "sq_previewsnippet"
90
- ]
91
- },
92
- "active": "1",
93
- "admin": "1"
94
- },
95
- {
96
- "name": "SQ_Controllers_Patterns",
97
- "description": "Patterns Class",
98
- "actions": {
99
- "action": [
100
- "sq_getpatterns"
101
- ]
102
- },
103
- "active": "1",
104
- "admin": "0"
105
- },
106
- {
107
- "name": "SQ_Controllers_BulkSeo",
108
- "actions": {
109
- "action": [
110
- "sq_ajax_assistant_bulkseo"
111
- ]
112
- },
113
- "admin": "1",
114
- "active": "1"
115
- },
116
- {
117
- "name": "SQ_Controllers_SeoSettings",
118
- "actions": {
119
- "action": [
120
- "sq_seosettings_automation",
121
- "sq_seosettings_bulkseo",
122
- "sq_seosettings_jsonld",
123
- "sq_seosettings_metas",
124
- "sq_seosettings_links",
125
- "sq_seosettings_social",
126
- "sq_seosettings_tracking",
127
- "sq_seosettings_webmaster",
128
- "sq_seosettings_sitemap",
129
- "sq_seosettings_robots",
130
- "sq_seosettings_favicon",
131
- "sq_seosettings_backupsettings",
132
- "sq_seosettings_backupseo",
133
- "sq_seosettings_restoresettings",
134
- "sq_seosettings_restoreseo",
135
- "sq_seosettings_importsettings",
136
- "sq_seosettings_importseo",
137
- "sq_seosettings_importall",
138
- "sq_seosettings_ga_revoke",
139
- "sq_seosettings_gsc_revoke",
140
- "sq_seosettings_gsc_check",
141
- "sq_seosettings_ga_check",
142
- "sq_reinstall",
143
- "sq_rollback",
144
- "sq_alerts_close",
145
- "sq_ajax_seosettings_save",
146
- "sq_ajax_automation_addpostype",
147
- "sq_ajax_automation_deletepostype",
148
- "sq_ajax_sla_sticky",
149
- "sq_ajax_gsc_code",
150
- "sq_ajax_ga_code",
151
- "sq_ajax_connection_check",
152
- "sq_seosettings_advanced"
153
- ]
154
- },
155
- "admin": "1",
156
- "active": "1"
157
- },
158
- {
159
- "name": "SQ_Controllers_Research",
160
- "actions": {
161
- "action": [
162
- "sq_briefcase_addlabel",
163
- "sq_briefcase_editlabel",
164
- "sq_briefcase_keywordlabel",
165
- "sq_briefcase_article",
166
- "sq_briefcase_doresearch",
167
- "sq_briefcase_addkeyword",
168
- "sq_briefcase_deletekeyword",
169
- "sq_briefcase_deletelabel",
170
- "sq_briefcase_deletefound",
171
- "sq_briefcase_savemain",
172
- "sq_briefcase_backup",
173
- "sq_briefcase_restore",
174
- "sq_ajax_briefcase_doserp",
175
- "sq_ajax_research_others",
176
- "sq_ajax_research_process",
177
- "sq_ajax_research_history",
178
- "sq_ajax_briefcase_bulk_delete",
179
- "sq_ajax_briefcase_bulk_label",
180
- "sq_ajax_briefcase_bulk_doserp",
181
- "sq_ajax_labels_bulk_delete"
182
- ]
183
- },
184
- "admin": "1",
185
- "active": "1"
186
- },
187
- {
188
- "name": "SQ_Controllers_Audits",
189
- "actions": {
190
- "action": [
191
- "sq_audits_settings",
192
- "sq_auditpages_getaudit",
193
- "sq_audits_getpage",
194
- "sq_audits_addnew",
195
- "sq_audits_page_update",
196
- "sq_audits_update",
197
- "sq_audits_delete"
198
- ]
199
- },
200
- "admin": "1",
201
- "active": "1"
202
- },
203
- {
204
- "name": "SQ_Controllers_Ranking",
205
- "actions": {
206
- "action": [
207
- "sq_ranking_settings",
208
- "sq_serp_refresh_post",
209
- "sq_serp_delete_keyword",
210
- "sq_ajax_rank_bulk_delete",
211
- "sq_ajax_rank_bulk_refresh"
212
- ]
213
- },
214
- "admin": "1",
215
- "active": "1"
216
- },
217
- {
218
- "name": "SQ_Controllers_Assistant",
219
- "actions": {
220
- "action": [
221
- "sq_settings_assistant",
222
- "sq_ajax_assistant"
223
- ]
224
- },
225
- "admin": "1",
226
- "active": "1"
227
- },
228
- {
229
- "name": "SQ_Controllers_CheckSeo",
230
- "actions": {
231
- "action": [
232
- "sq_checkseo",
233
- "sq_fixsettings",
234
- "sq_donetask",
235
- "sq_resetignored",
236
- "sq_moretasks",
237
- "sq_ajax_checkseo",
238
- "sq_ajax_getgoals"
239
- ]
240
- },
241
- "admin": "1",
242
- "active": "1"
243
- },
244
- {
245
- "name": "SQ_Controllers_Onboarding",
246
- "actions": {
247
- "action": [
248
- "sq_onboarding_commitment",
249
- "sq_onboading_checksite",
250
- "sq_onboarding_settings"
251
- ]
252
- },
253
- "admin": "1",
254
- "active": "1"
255
- },
256
- {
257
- "name": "SQ_Core_BlockJorney",
258
- "actions": {
259
- "action": [
260
- "sq_journey_close"
261
- ]
262
- },
263
- "admin": "1",
264
- "active": "1"
265
- },
266
- {
267
- "name": "SQ_Core_BlockSupport",
268
- "actions": {
269
- "action": [
270
- "sq_feedback",
271
- "sq_uninstall_feedback"
272
- ]
273
- },
274
- "admin": "1",
275
- "active": "1"
276
- },
277
- {
278
- "name": "SQ_Core_BlockSearch",
279
- "actions": {
280
- "action": [
281
- "sq_ajax_search"
282
- ]
283
- },
284
- "admin": "1",
285
- "active": "1"
286
- },
287
- {
288
- "name": "SQ_Controllers_Dashboard",
289
- "actions": {
290
- "action": [
291
- "sq_ajaxcheckseo"
292
- ]
293
- },
294
- "admin": "1",
295
- "active": "1"
296
- }
297
- ]
298
- }
299
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
config/paths.php CHANGED
@@ -18,8 +18,8 @@ define('_SQ_SITE_HOST_', parse_url(home_url(), PHP_URL_HOST));
18
  define('_SQ_SUPPORT_EMAIL_', 'support@squirrly.co');
19
  defined('_SQ_STATIC_API_URL_') || define('_SQ_STATIC_API_URL_', '//storage.googleapis.com/squirrly/');
20
  defined('_SQ_SUPPORT_EMAIL_URL_') || define('_SQ_SUPPORT_EMAIL_URL_', 'http://plugin.squirrly.co/contact/');
21
- defined('_SQ_SUPPORT_FACEBOOK_URL_') || define('_SQ_SUPPORT_FACEBOOK_URL_', 'https://www.facebook.com/Squirrly.co');
22
- defined('_SQ_HOWTO_URL_') || define('_SQ_HOWTO_URL_', 'https://howto.squirrly.co/wordpress-seo/');
23
  defined('_SQ_SUPPORT_URL_') || define('_SQ_SUPPORT_URL_', 'https://www.dmsuperstars.com/squirrly-support/');
24
 
25
  /* Directories */
18
  define('_SQ_SUPPORT_EMAIL_', 'support@squirrly.co');
19
  defined('_SQ_STATIC_API_URL_') || define('_SQ_STATIC_API_URL_', '//storage.googleapis.com/squirrly/');
20
  defined('_SQ_SUPPORT_EMAIL_URL_') || define('_SQ_SUPPORT_EMAIL_URL_', 'http://plugin.squirrly.co/contact/');
21
+ defined('_SQ_SUPPORT_FACEBOOK_URL_') || define('_SQ_SUPPORT_FACEBOOK_URL_', 'https://www.facebook.com/groups/squirrlyjourneyteam');
22
+ defined('_SQ_HOWTO_URL_') || define('_SQ_HOWTO_URL_', 'https://howto12.squirrly.co/');
23
  defined('_SQ_SUPPORT_URL_') || define('_SQ_SUPPORT_URL_', 'https://www.dmsuperstars.com/squirrly-support/');
24
 
25
  /* Directories */
controllers/Account.php CHANGED
@@ -8,38 +8,32 @@ class SQ_Controllers_Account extends SQ_Classes_FrontController
8
  {
9
 
10
  /**
11
- *
12
  *
13
- * @var object Checkin process
14
  */
15
  public $checkin;
16
 
17
- public function action()
18
  {
19
-
20
  switch (SQ_Classes_Helpers_Tools::getValue('action')) {
21
- case 'sq_ajax_account_getaccount':
22
- $json = array();
23
-
24
- $this->checkin = SQ_Classes_RemoteController::checkin();
25
 
26
- if (!is_wp_error($this->checkin)) {
27
 
28
- $json['html'] = $this->get_view('Blocks/Account');
29
 
30
- if (SQ_Classes_Helpers_Tools::isAjax()) {
31
- SQ_Classes_Helpers_Tools::setHeader('json');
32
 
33
  if (SQ_Classes_Error::isError()) {
34
  $json['error'] = SQ_Classes_Error::getError();
35
  }
36
 
37
- echo wp_json_encode($json);
38
- exit();
39
  }
40
-
41
- }
42
- break;
43
  }
44
  }
45
  }
8
  {
9
 
10
  /**
11
+ *
12
  *
13
+ * @var object Checkin process
14
  */
15
  public $checkin;
16
 
17
+ public function action()
18
  {
 
19
  switch (SQ_Classes_Helpers_Tools::getValue('action')) {
20
+ case 'sq_ajax_account_getaccount':
21
+ SQ_Classes_Helpers_Tools::setHeader('json');
22
+ $json = array();
 
23
 
24
+ $this->checkin = SQ_Classes_RemoteController::checkin();
25
 
26
+ if (!is_wp_error($this->checkin)) {
27
 
28
+ $json['html'] = $this->get_view('Blocks/Account');
 
29
 
30
  if (SQ_Classes_Error::isError()) {
31
  $json['error'] = SQ_Classes_Error::getError();
32
  }
33
 
 
 
34
  }
35
+ echo wp_json_encode($json);
36
+ exit();
 
37
  }
38
  }
39
  }
controllers/Assistant.php CHANGED
@@ -50,14 +50,12 @@ class SQ_Controllers_Assistant extends SQ_Classes_FrontController
50
  {
51
  //Checkin to API V2
52
  $this->checkin = SQ_Classes_RemoteController::checkin();
53
-
54
- add_action('sq_form_notices', array($this, 'getNotificationBar'));
55
  }
56
 
57
  public function settings()
58
  {
59
  $search = (string)SQ_Classes_Helpers_Tools::getValue('skeyword', '');
60
- $labels = SQ_Classes_Helpers_Tools::getValue('slabel', false);
61
 
62
  $args = array();
63
  $args['search'] = $search;
50
  {
51
  //Checkin to API V2
52
  $this->checkin = SQ_Classes_RemoteController::checkin();
 
 
53
  }
54
 
55
  public function settings()
56
  {
57
  $search = (string)SQ_Classes_Helpers_Tools::getValue('skeyword', '');
58
+ $labels = SQ_Classes_Helpers_Tools::getValue('slabel');
59
 
60
  $args = array();
61
  $args['search'] = $search;
controllers/Audits.php CHANGED
@@ -97,8 +97,8 @@ class SQ_Controllers_Audits extends SQ_Classes_FrontController
97
 
98
  public function compare()
99
  {
100
- $sids = SQ_Classes_Helpers_Tools::getValue('sid', false);
101
-
102
  //get all the ids
103
  if ($sids && !empty($sids)) {
104
  foreach ($sids as $sid) {
@@ -121,7 +121,7 @@ class SQ_Controllers_Audits extends SQ_Classes_FrontController
121
  public function audit()
122
  {
123
  $days_back = (int)SQ_Classes_Helpers_Tools::getValue('days_back', 30);
124
- $sid = (int)SQ_Classes_Helpers_Tools::getValue('sid', false);
125
 
126
  if ($sid) {
127
 
@@ -136,7 +136,7 @@ class SQ_Controllers_Audits extends SQ_Classes_FrontController
136
  if (!empty($auditpages)) {
137
  foreach ($auditpages as $auditpage) {
138
 
139
- /** @var SQ_Models_Domain_FocusPage $auditpage */
140
  $auditpage = SQ_Classes_ObjController::getDomain('SQ_Models_Domain_AuditPage', $auditpage);
141
 
142
  //If there is a local page, then show focus
@@ -168,8 +168,6 @@ class SQ_Controllers_Audits extends SQ_Classes_FrontController
168
 
169
  public function audits()
170
  {
171
- add_action('sq_form_notices', array($this, 'getNotificationBar'));
172
-
173
  SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('audits');
174
  SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('knob');
175
 
@@ -210,6 +208,7 @@ class SQ_Controllers_Audits extends SQ_Classes_FrontController
210
  }
211
  }
212
  }
 
213
  return $this->auditpages;
214
  }
215
 
@@ -238,7 +237,7 @@ class SQ_Controllers_Audits extends SQ_Classes_FrontController
238
  seriesType: "bars",
239
  series: {2: {type: "line"}},
240
  legend: {position: "bottom"},
241
- colors:["#589ee4","#17d1f3"]
242
  };
243
 
244
  var chart = new google.visualization.ComboChart(document.getElementById(id));
97
 
98
  public function compare()
99
  {
100
+ $sids = SQ_Classes_Helpers_Tools::getValue('sid');
101
+ $this->audits = array();
102
  //get all the ids
103
  if ($sids && !empty($sids)) {
104
  foreach ($sids as $sid) {
121
  public function audit()
122
  {
123
  $days_back = (int)SQ_Classes_Helpers_Tools::getValue('days_back', 30);
124
+ $sid = (int)SQ_Classes_Helpers_Tools::getValue('sid');
125
 
126
  if ($sid) {
127
 
136
  if (!empty($auditpages)) {
137
  foreach ($auditpages as $auditpage) {
138
 
139
+ /** @var SQ_Models_Domain_FocusPage $auditpage */
140
  $auditpage = SQ_Classes_ObjController::getDomain('SQ_Models_Domain_AuditPage', $auditpage);
141
 
142
  //If there is a local page, then show focus
168
 
169
  public function audits()
170
  {
 
 
171
  SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('audits');
172
  SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('knob');
173
 
208
  }
209
  }
210
  }
211
+
212
  return $this->auditpages;
213
  }
214
 
237
  seriesType: "bars",
238
  series: {2: {type: "line"}},
239
  legend: {position: "bottom"},
240
+ colors:["#6200EE","#589ee4"]
241
  };
242
 
243
  var chart = new google.visualization.ComboChart(document.getElementById(id));
controllers/Automation.php ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined('ABSPATH') || die('Cheatin\' uh?');
3
+
4
+ class SQ_Controllers_Automation extends SQ_Classes_FrontController
5
+ {
6
+
7
+ public $pages = array();
8
+
9
+ function init()
10
+ {
11
+ $tab = preg_replace("/[^a-zA-Z0-9]/", "", SQ_Classes_Helpers_Tools::getValue('tab', 'types'));
12
+
13
+ SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('bootstrap-reboot');
14
+ if (is_rtl()) {
15
+ SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('popper');
16
+ SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('bootstrap.rtl');
17
+ SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('rtl');
18
+ } else {
19
+ SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('bootstrap');
20
+ }
21
+ SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('bootstrap-select');
22
+
23
+ SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('switchery');
24
+ SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('fontawesome');
25
+ SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('global');
26
+
27
+ SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('assistant');
28
+ SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('navbar');
29
+ SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('seosettings');
30
+
31
+ if (method_exists($this, $tab)) {
32
+ call_user_func(array($this, $tab));
33
+ }
34
+
35
+ if (function_exists('wp_enqueue_media')) {
36
+ wp_enqueue_media();
37
+ wp_enqueue_style('media-views');
38
+ }
39
+
40
+ //@ob_flush();
41
+ $this->show_view('Automation/' . esc_attr(ucfirst($tab)));
42
+
43
+ //get the modal window for the assistant popup
44
+ echo SQ_Classes_ObjController::getClass('SQ_Models_Assistant')->getModal();
45
+ }
46
+
47
+ public function automation()
48
+ {
49
+ SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('highlight');
50
+ SQ_Classes_ObjController::getClass('SQ_Controllers_Patterns')->init();
51
+ }
52
+
53
+ /**
54
+ * Called when action is triggered
55
+ *
56
+ * @return void
57
+ */
58
+ public function action()
59
+ {
60
+ parent::action();
61
+
62
+ switch (SQ_Classes_Helpers_Tools::getValue('action')) {
63
+
64
+ ///////////////////////////////////////////SEO SETTINGS AUTOMATION
65
+ case 'sq_seosettings_automation':
66
+
67
+ if (!SQ_Classes_Helpers_Tools::userCan('sq_manage_settings')) {
68
+ return;
69
+ }
70
+
71
+ //Save the settings
72
+ if (!empty($_POST)) {
73
+ SQ_Classes_ObjController::getClass('SQ_Models_Settings')->saveValues($_POST);
74
+ }
75
+
76
+
77
+ //show the saved message
78
+ if (!SQ_Classes_Error::isError()) SQ_Classes_Error::setMessage(esc_html__("Saved", 'squirrly-seo'));
79
+
80
+ /************************ Automation *******************************************************/
81
+ case 'sq_automation_addpostype':
82
+ $response = array();
83
+ if (!SQ_Classes_Helpers_Tools::userCan('sq_manage_settings')) {
84
+ $response['error'] = SQ_Classes_Error::showNotices(esc_html__("You do not have permission to perform this action", 'squirrly-seo'), 'sq_error');
85
+ echo wp_json_encode($response);
86
+ exit();
87
+ }
88
+
89
+ //Get the new post type
90
+ $posttype = SQ_Classes_Helpers_Tools::getValue('posttype');
91
+ $filter = array('public' => true, '_builtin' => false);
92
+ $types = get_post_types($filter);
93
+ foreach ($types as $pattern => $type) {
94
+ if($post_type_obj = get_post_type_object($pattern)) {
95
+ if($post_type_obj->has_archive) {
96
+ $types['archive-' . $pattern] = 'archive-' . $pattern;
97
+ }
98
+ }
99
+ }
100
+
101
+ $filter = array('public' => true,);
102
+ $taxonomies = get_taxonomies($filter);
103
+ foreach ($taxonomies as $pattern => $type) {
104
+ $types['tax-' . $pattern] = 'tax-' . $pattern;
105
+ }
106
+
107
+ //If the post type is in the list of types
108
+ if ($posttype && in_array($posttype, $types)) {
109
+ $patterns = SQ_Classes_Helpers_Tools::getOption('patterns');
110
+ //if the post type does not already exists
111
+ if (!isset($patterns[$posttype])) {
112
+ //add the custom rights to the new post type
113
+ $patterns[$posttype] = $patterns['custom'];
114
+ $patterns[$posttype]['protected'] = 0;
115
+ //save the options in database
116
+ SQ_Classes_Helpers_Tools::saveOptions('patterns', $patterns);
117
+
118
+ SQ_Classes_Error::setMessage(esc_html__("Saved", 'squirrly-seo'), 'sq_success');
119
+ break;
120
+ }
121
+ }
122
+
123
+
124
+ //Return error in case the post is not saved
125
+ SQ_Classes_Error::setError(esc_html__("Could not add the post type.", 'squirrly-seo'));
126
+ break;
127
+ case 'sq_ajax_automation_deletepostype':
128
+ SQ_Classes_Helpers_Tools::setHeader('json');
129
+ $response = array();
130
+ if (!SQ_Classes_Helpers_Tools::userCan('sq_manage_settings')) {
131
+ $response['error'] = SQ_Classes_Error::showNotices(esc_html__("You do not have permission to perform this action", 'squirrly-seo'), 'sq_error');
132
+ echo wp_json_encode($response);
133
+ exit();
134
+ }
135
+
136
+
137
+ //Get the new post type
138
+ $posttype = SQ_Classes_Helpers_Tools::getValue('value');
139
+
140
+ //If the post type is in the list of types
141
+ if ($posttype && $posttype <> '') {
142
+ $patterns = SQ_Classes_Helpers_Tools::getOption('patterns');
143
+ //if the post type exists in the patterns
144
+ if (isset($patterns[$posttype])) {
145
+ //add the custom rights to the new post type
146
+ unset($patterns[$posttype]);
147
+
148
+ //save the options in database
149
+ SQ_Classes_Helpers_Tools::saveOptions('patterns', $patterns);
150
+
151
+ $response['data'] = SQ_Classes_Error::showNotices(esc_html__("Saved", 'squirrly-seo'), 'sq_success');
152
+ echo wp_json_encode($response);
153
+ exit();
154
+ }
155
+ }
156
+
157
+
158
+ //Return error in case the post is not saved
159
+ $response['data'] = SQ_Classes_Error::showNotices(esc_html__("Could not add the post type.", 'squirrly-seo'), 'sq_error');
160
+ echo wp_json_encode($response);
161
+ exit();
162
+ break;
163
+
164
+ }
165
+
166
+ }
167
+
168
+ }
controllers/BulkSeo.php CHANGED
@@ -44,8 +44,6 @@ class SQ_Controllers_BulkSeo extends SQ_Classes_FrontController
44
 
45
  public function bulkseo()
46
  {
47
- add_action('sq_form_notices', array($this,'getNotificationBar'));
48
-
49
  SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('bulkseo');
50
  SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('labels');
51
 
44
 
45
  public function bulkseo()
46
  {
 
 
47
  SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('bulkseo');
48
  SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('labels');
49
 
controllers/CheckSeo.php CHANGED
@@ -54,8 +54,6 @@ class SQ_Controllers_CheckSeo extends SQ_Classes_FrontController
54
  //Load the tasks from database and filter them
55
  $tasks = $this->model->getTasks();
56
 
57
- // $this->model->dbtasks['tasks_for_today'] = array();
58
- // $this->model->dbtasks['count_tasks_for_today'] = 300;
59
  if (!empty($report)) {
60
 
61
  if (!isset($this->model->dbtasks['count_tasks_for_today'])) {
@@ -130,34 +128,34 @@ class SQ_Controllers_CheckSeo extends SQ_Classes_FrontController
130
  foreach ($row['tools'] as &$tool) {
131
  switch ($tool) {
132
  case 'On-Page SEO':
133
- $tool = '<a href="https://plugin.squirrly.co/bulk-seo-settings/" target="_blank"><strong class="text-info">' . $tool . '</strong></a>';
134
  break;
135
  case 'SEO Automation':
136
- $tool = '<a href="https://howto.squirrly.co/kb/seo-automation/" target="_blank"><strong class="text-info">' . $tool . '</strong></a>';
137
  break;
138
  case 'SEO Snippet':
139
- $tool = '<a href="https://plugin.squirrly.co/seo-snippet-tool/" target="_blank"><strong class="text-info">' . $tool . '</strong></a>';
140
  break;
141
  case 'Focus Pages':
142
- $tool = '<a href="https://plugin.squirrly.co/focus-pages/" target="_blank"><strong class="text-info">' . $tool . '</strong></a>';
143
  break;
144
  case 'Live Assistant':
145
- $tool = '<a href="https://plugin.squirrly.co/seo-virtual-assistant/" target="_blank"><strong class="text-info">' . $tool . '</strong></a>';
146
  break;
147
  case 'Multiple Keyword Optimization':
148
- $tool = '<a href="https://plugin.squirrly.co/seo-virtual-assistant/" target="_blank"><strong class="text-info">' . $tool . '</strong></a>';
149
  break;
150
  case 'Keyword Research':
151
- $tool = '<a href="https://plugin.squirrly.co/best-keyword-research-tool-for-seo/" target="_blank"><strong class="text-info">' . $tool . '</strong></a>';
152
  break;
153
  case 'Briefcase':
154
- $tool = '<a href="https://plugin.squirrly.co/briefcase-keyword-management-tool/" target="_blank"><strong class="text-info">' . $tool . '</strong></a>';
155
  break;
156
  case 'Rankings':
157
- $tool = '<a href="https://plugin.squirrly.co/google-serp-checker/" target="_blank"><strong class="text-info">' . $tool . '</strong></a>';
158
  break;
159
  case 'Audits':
160
- $tool = '<a href="https://plugin.squirrly.co/site-seo-audit-tool/" target="_blank"><strong class="text-info">' . $tool . '</strong></a>';
161
  break;
162
  }
163
  }
@@ -316,8 +314,8 @@ class SQ_Controllers_CheckSeo extends SQ_Classes_FrontController
316
 
317
  break;
318
  case 'sq_fixsettings':
319
- $name = SQ_Classes_Helpers_Tools::getValue('name', false);
320
- $value = SQ_Classes_Helpers_Tools::getValue('value', false);
321
 
322
  if ($name) {
323
  if (in_array($name, array_keys(SQ_Classes_Helpers_Tools::$options))) {
@@ -334,7 +332,7 @@ class SQ_Controllers_CheckSeo extends SQ_Classes_FrontController
334
  SQ_Classes_Error::setError(esc_html__("Could not fix it. You need to change it manually.", 'squirrly-seo'));
335
  break;
336
  case 'sq_donetask':
337
- $name = SQ_Classes_Helpers_Tools::getValue('name', false);
338
 
339
  $this->model->doneTask($name);
340
 
54
  //Load the tasks from database and filter them
55
  $tasks = $this->model->getTasks();
56
 
 
 
57
  if (!empty($report)) {
58
 
59
  if (!isset($this->model->dbtasks['count_tasks_for_today'])) {
128
  foreach ($row['tools'] as &$tool) {
129
  switch ($tool) {
130
  case 'On-Page SEO':
131
+ $tool = '<a href="https://plugin.squirrly.co/bulk-seo-settings/" target="_blank">' . $tool . '</a>';
132
  break;
133
  case 'SEO Automation':
134
+ $tool = '<a href="https://howto12.squirrly.co/kb/seo-automation/" target="_blank">' . $tool . '</a>';
135
  break;
136
  case 'SEO Snippet':
137
+ $tool = '<a href="https://plugin.squirrly.co/seo-snippet-tool/" target="_blank">' . $tool . '</a>';
138
  break;
139
  case 'Focus Pages':
140
+ $tool = '<a href="https://plugin.squirrly.co/focus-pages/" target="_blank">' . $tool . '</a>';
141
  break;
142
  case 'Live Assistant':
143
+ $tool = '<a href="https://plugin.squirrly.co/seo-virtual-assistant/" target="_blank">' . $tool . '</a>';
144
  break;
145
  case 'Multiple Keyword Optimization':
146
+ $tool = '<a href="https://plugin.squirrly.co/seo-virtual-assistant/" target="_blank">' . $tool . '</a>';
147
  break;
148
  case 'Keyword Research':
149
+ $tool = '<a href="https://plugin.squirrly.co/best-keyword-research-tool-for-seo/" target="_blank">' . $tool . '</a>';
150
  break;
151
  case 'Briefcase':
152
+ $tool = '<a href="https://plugin.squirrly.co/briefcase-keyword-management-tool/" target="_blank">' . $tool . '</a>';
153
  break;
154
  case 'Rankings':
155
+ $tool = '<a href="https://plugin.squirrly.co/google-serp-checker/" target="_blank">' . $tool . '</a>';
156
  break;
157
  case 'Audits':
158
+ $tool = '<a href="https://plugin.squirrly.co/site-seo-audit-tool/" target="_blank">' . $tool . '</a>';
159
  break;
160
  }
161
  }
314
 
315
  break;
316
  case 'sq_fixsettings':
317
+ $name = SQ_Classes_Helpers_Tools::getValue('name');
318
+ $value = SQ_Classes_Helpers_Tools::getValue('value');
319
 
320
  if ($name) {
321
  if (in_array($name, array_keys(SQ_Classes_Helpers_Tools::$options))) {
332
  SQ_Classes_Error::setError(esc_html__("Could not fix it. You need to change it manually.", 'squirrly-seo'));
333
  break;
334
  case 'sq_donetask':
335
+ $name = SQ_Classes_Helpers_Tools::getValue('name');
336
 
337
  $this->model->doneTask($name);
338
 
controllers/Cron.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- defined('ABSPATH') || die('Cheatin\' uh?');
3
-
4
- class SQ_Controllers_Cron extends SQ_Classes_FrontController {
5
-
6
- public function processSEOCheckCron() {
7
- //make sure the classes are loaded
8
- SQ_Classes_ObjController::getClass('SQ_Classes_Helpers_Tools');
9
-
10
- //Check the SEO and save the Report
11
- if ($report_time = SQ_Classes_Helpers_Tools::getOption('seoreport_time')) {
12
- if ((time() - (int)$report_time) < (3600 * 12)) {
13
- return false;
14
- }
15
- }
16
-
17
- SQ_Classes_ObjController::getClass('SQ_Models_CheckSeo')->checkSEO();
18
- }
19
-
20
-
21
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
controllers/Dashboard.php CHANGED
@@ -17,8 +17,6 @@ class SQ_Controllers_Dashboard extends SQ_Classes_FrontController
17
  SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('rtl');
18
  }
19
 
20
- add_action('sq_form_notices', array($this, 'getNotificationBar'));
21
-
22
  $this->show_view('Blocks/Dashboard');
23
  }
24
 
17
  SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('rtl');
18
  }
19
 
 
 
20
  $this->show_view('Blocks/Dashboard');
21
  }
22
 
controllers/FocusPages.php CHANGED
@@ -107,8 +107,6 @@ class SQ_Controllers_FocusPages extends SQ_Classes_FrontController
107
  */
108
  public function pagelist()
109
  {
110
- add_action('sq_form_notices', array($this, 'getNotificationBar'));
111
-
112
  //Set the Labels and Categories
113
  SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('focuspages');
114
  SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('labels');
@@ -124,7 +122,7 @@ class SQ_Controllers_FocusPages extends SQ_Classes_FrontController
124
  {
125
  $labels = SQ_Classes_Helpers_Tools::getValue('slabel', array());
126
  $days_back = (int)SQ_Classes_Helpers_Tools::getValue('days_back', 90);
127
- $sid = SQ_Classes_Helpers_Tools::getValue('sid', false);
128
 
129
  SQ_Classes_ObjController::getClass('SQ_Models_FocusPages')->init();
130
  $this->checkin = SQ_Classes_RemoteController::checkin();
@@ -155,11 +153,7 @@ class SQ_Controllers_FocusPages extends SQ_Classes_FrontController
155
  }
156
  }
157
 
158
- /**
159
- *
160
- *
161
- * @var SQ_Models_Domain_FocusPage $focuspage
162
- */
163
  $focuspage = SQ_Classes_ObjController::getDomain('SQ_Models_Domain_FocusPage', $focuspage);
164
 
165
  //set the connection info with GSC and GA
@@ -230,7 +224,7 @@ class SQ_Controllers_FocusPages extends SQ_Classes_FrontController
230
  seriesType: "bars",
231
  series: {2: {type: "line"}},
232
  legend: {position: "bottom"},
233
- colors:["#17c6ea"]
234
  };
235
 
236
  var chart = new google.visualization.ComboChart(document.getElementById(id));
@@ -248,7 +242,7 @@ class SQ_Controllers_FocusPages extends SQ_Classes_FrontController
248
  enableInteractivity: "true",
249
  tooltip: {trigger: "auto"},
250
  pointSize: "2",
251
- colors: ["#55b2ca"],
252
  hAxis: {
253
  baselineColor: "transparent",
254
  gridlineColor: "transparent",
@@ -289,7 +283,7 @@ class SQ_Controllers_FocusPages extends SQ_Classes_FrontController
289
  seriesType: "bars",
290
  series: {2: {type: "line"}},
291
  legend: {position: "bottom"},
292
- colors:["#17c6ea"]
293
  };
294
 
295
  var chart = new google.visualization.ComboChart(document.getElementById(id));
@@ -445,7 +439,7 @@ class SQ_Controllers_FocusPages extends SQ_Classes_FrontController
445
  return;
446
  }
447
 
448
- if ($post_id = SQ_Classes_Helpers_Tools::getValue('id', false)) {
449
  SQ_Classes_RemoteController::deleteFocusPage(array('user_post_id' => $post_id));
450
  SQ_Classes_Error::setError(esc_html__("The focus page is deleted", 'squirrly-seo') . " <br /> ", 'success');
451
  } else {
107
  */
108
  public function pagelist()
109
  {
 
 
110
  //Set the Labels and Categories
111
  SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('focuspages');
112
  SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('labels');
122
  {
123
  $labels = SQ_Classes_Helpers_Tools::getValue('slabel', array());
124
  $days_back = (int)SQ_Classes_Helpers_Tools::getValue('days_back', 90);
125
+ $sid = SQ_Classes_Helpers_Tools::getValue('sid');
126
 
127
  SQ_Classes_ObjController::getClass('SQ_Models_FocusPages')->init();
128
  $this->checkin = SQ_Classes_RemoteController::checkin();
153
  }
154
  }
155
 
156
+ /** @var SQ_Models_Domain_FocusPage $focuspage */
 
 
 
 
157
  $focuspage = SQ_Classes_ObjController::getDomain('SQ_Models_Domain_FocusPage', $focuspage);
158
 
159
  //set the connection info with GSC and GA
224
  seriesType: "bars",
225
  series: {2: {type: "line"}},
226
  legend: {position: "bottom"},
227
+ colors:["#6200EE"]
228
  };
229
 
230
  var chart = new google.visualization.ComboChart(document.getElementById(id));
242
  enableInteractivity: "true",
243
  tooltip: {trigger: "auto"},
244
  pointSize: "2",
245
+ colors: ["#6200EE"],
246
  hAxis: {
247
  baselineColor: "transparent",
248
  gridlineColor: "transparent",
283
  seriesType: "bars",
284
  series: {2: {type: "line"}},
285
  legend: {position: "bottom"},
286
+ colors:["#6200EE"]
287
  };
288
 
289
  var chart = new google.visualization.ComboChart(document.getElementById(id));
439
  return;
440
  }
441
 
442
+ if ($post_id = SQ_Classes_Helpers_Tools::getValue('id')) {
443
  SQ_Classes_RemoteController::deleteFocusPage(array('user_post_id' => $post_id));
444
  SQ_Classes_Error::setError(esc_html__("The focus page is deleted", 'squirrly-seo') . " <br /> ", 'success');
445
  } else {
controllers/Frontend.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  defined('ABSPATH') || die('Cheatin\' uh?');
3
 
4
- class SQ_Controllers_Frontend extends SQ_Classes_FrontController
5
  {
6
 
7
  /**
@@ -59,9 +59,11 @@ class SQ_Controllers_Frontend extends SQ_Classes_FrontController
59
  public function hookBuffer()
60
  {
61
  add_filter('sq_buffer', function ($buffer){
 
62
  if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] == 'https://www.squirrly.co') {
63
  return '.' . $buffer;
64
  }
 
65
  return $buffer;
66
  });
67
 
@@ -123,7 +125,7 @@ class SQ_Controllers_Frontend extends SQ_Classes_FrontController
123
  }
124
 
125
  if (SQ_Classes_Helpers_Tools::isPluginInstalled('elementor/elementor.php')) {
126
- if (SQ_Classes_Helpers_Tools::getValue('elementor-preview', false)) {
127
  SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('elementor');
128
  }
129
  }
1
  <?php
2
  defined('ABSPATH') || die('Cheatin\' uh?');
3
 
4
+ class SQ_Controllers_Frontend extends SQ_Classes_FrontController
5
  {
6
 
7
  /**
59
  public function hookBuffer()
60
  {
61
  add_filter('sq_buffer', function ($buffer){
62
+
63
  if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] == 'https://www.squirrly.co') {
64
  return '.' . $buffer;
65
  }
66
+
67
  return $buffer;
68
  });
69
 
125
  }
126
 
127
  if (SQ_Classes_Helpers_Tools::isPluginInstalled('elementor/elementor.php')) {
128
+ if (SQ_Classes_Helpers_Tools::getValue('elementor-preview')) {
129
  SQ_Classes_ObjController::getClass('SQ_Classes_DisplayController')->loadMedia('elementor');
130
  }
131
  }
controllers/Help.php DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
- defined('ABSPATH') || die('Cheatin\' uh?');
3
-
4
- /**
5
- * Help & Support
6
- */
7
- class SQ_Controllers_Help extends SQ_Classes_FrontController {
8
-
9
- public function init() {
10
- }
11
-
12
-
13
- }