SEO SQUIRRLY™ - Version 11.1.05

Version Description

Download this release

Release Info

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

Code changes from version 11.1.04 to 11.1.05

classes/RemoteController.php CHANGED
@@ -31,6 +31,7 @@ class SQ_Classes_RemoteController {
31
  'timeout' => 20,
32
  'headers' => array(
33
  'USER-TOKEN' => SQ_Classes_Helpers_Tools::getOption('sq_api'),
 
34
  'USER-URL' => apply_filters('sq_homeurl', get_bloginfo('url')),
35
  'LANG' => apply_filters('sq_language', get_bloginfo('language')),
36
  'VERSQ' => (int)str_replace('.', '', SQ_VERSION)
@@ -302,6 +303,10 @@ class SQ_Classes_RemoteController {
302
  SQ_Classes_Helpers_Tools::saveOptions('connect', $connect);
303
  }
304
 
 
 
 
 
305
  set_transient('sq_checkin', $json->data, 60);
306
  return $json->data;
307
  }
@@ -1324,6 +1329,7 @@ class SQ_Classes_RemoteController {
1324
  sq_version: "' . SQ_VERSION . '",
1325
  sq_sla_type: "' . SQ_Classes_Helpers_Tools::getOption('sq_sla_type') . '",
1326
  token: "' . SQ_Classes_Helpers_Tools::getOption('sq_api') . '",
 
1327
  sq_baseurl: "' . _SQ_STATIC_API_URL_ . '",
1328
  sq_uri: "' . SQ_URI . '",
1329
  sq_apiurl: "' . _SQ_APIV2_URL_ . '",
31
  'timeout' => 20,
32
  'headers' => array(
33
  'USER-TOKEN' => SQ_Classes_Helpers_Tools::getOption('sq_api'),
34
+ 'URL-TOKEN' => (SQ_Classes_Helpers_Tools::getOption('sq_cloud_connect') ? SQ_Classes_Helpers_Tools::getOption('sq_cloud_token') : false),
35
  'USER-URL' => apply_filters('sq_homeurl', get_bloginfo('url')),
36
  'LANG' => apply_filters('sq_language', get_bloginfo('language')),
37
  'VERSQ' => (int)str_replace('.', '', SQ_VERSION)
303
  SQ_Classes_Helpers_Tools::saveOptions('connect', $connect);
304
  }
305
 
306
+ if(isset($json->data->subscription_devkit)){
307
+ SQ_Classes_Helpers_Tools::saveOptions('sq_auto_devkit', (int)$json->data->subscription_devkit);
308
+ }
309
+
310
  set_transient('sq_checkin', $json->data, 60);
311
  return $json->data;
312
  }
1329
  sq_version: "' . SQ_VERSION . '",
1330
  sq_sla_type: "' . SQ_Classes_Helpers_Tools::getOption('sq_sla_type') . '",
1331
  token: "' . SQ_Classes_Helpers_Tools::getOption('sq_api') . '",
1332
+ url_token: "' . (SQ_Classes_Helpers_Tools::getOption('sq_cloud_connect') ? SQ_Classes_Helpers_Tools::getOption('sq_cloud_token') : false) . '",
1333
  sq_baseurl: "' . _SQ_STATIC_API_URL_ . '",
1334
  sq_uri: "' . SQ_URI . '",
1335
  sq_apiurl: "' . _SQ_APIV2_URL_ . '",
classes/helpers/DevKit.php CHANGED
@@ -9,32 +9,34 @@ class SQ_Classes_Helpers_DevKit {
9
 
10
  public function __construct() {
11
 
12
- if (SQ_Classes_Helpers_DevKit::getOption('sq_devkit_name') <> '') {
13
- if (isset($_SERVER['REQUEST_URI']) && function_exists('get_plugin_data')) {
14
- if (strpos($_SERVER['REQUEST_URI'], '/plugins.php') !== false) {
15
- $data = get_plugin_data(_SQ_ROOT_DIR_ . 'squirrly.php');
16
- if (isset($data['Name'])) {
17
- self::$plugin['name'] = $data['Name'];
18
- add_filter('pre_kses', array($this, 'changeString'), 1, 1);
 
 
 
19
  }
20
  }
21
  }
22
- }
23
 
24
- //Hook DevKit options
25
- if (SQ_Classes_Helpers_DevKit::getOption('sq_api')) {
26
- add_filter('admin_head', array($this, 'hookHead'));
27
- add_filter('sq_menu', array($this, 'manageMenu'));
28
- add_filter('sq_features', array($this, 'manageFeatures'));
29
- add_filter('sq_logo', array($this, 'getCustomLogo'));
30
- add_filter('sq_name', array($this, 'getCustomName'));
31
- add_filter('sq_menu_name', array($this, 'getCustomMenuName'));
32
- add_filter('sq_audit_success_task', array($this, 'getCustomAuditSuccessTask'));
33
- add_filter('sq_audit_fail_task', array($this, 'getCustomAuditFailTask'));
34
- add_action('sq_seo_errors', array($this, 'getSEOErrors'));
35
 
 
36
  }
37
-
38
  }
39
 
40
  //Check if Next SEO Goals are active
9
 
10
  public function __construct() {
11
 
12
+ if(SQ_Classes_Helpers_DevKit::getOption('sq_auto_devkit')) {
13
+
14
+ if (SQ_Classes_Helpers_DevKit::getOption('sq_devkit_name') <> '') {
15
+ if (isset($_SERVER['REQUEST_URI']) && function_exists('get_plugin_data')) {
16
+ if (strpos($_SERVER['REQUEST_URI'], '/plugins.php') !== false) {
17
+ $data = get_plugin_data(_SQ_ROOT_DIR_ . 'squirrly.php');
18
+ if (isset($data['Name'])) {
19
+ self::$plugin['name'] = $data['Name'];
20
+ add_filter('pre_kses', array($this, 'changeString'), 1, 1);
21
+ }
22
  }
23
  }
24
  }
 
25
 
26
+ //Hook DevKit options
27
+ if (SQ_Classes_Helpers_DevKit::getOption('sq_api')) {
28
+ add_filter('admin_head', array($this, 'hookHead'));
29
+ add_filter('sq_menu', array($this, 'manageMenu'));
30
+ add_filter('sq_features', array($this, 'manageFeatures'));
31
+ add_filter('sq_logo', array($this, 'getCustomLogo'));
32
+ add_filter('sq_name', array($this, 'getCustomName'));
33
+ add_filter('sq_menu_name', array($this, 'getCustomMenuName'));
34
+ add_filter('sq_audit_success_task', array($this, 'getCustomAuditSuccessTask'));
35
+ add_filter('sq_audit_fail_task', array($this, 'getCustomAuditFailTask'));
36
+ add_action('sq_seo_errors', array($this, 'getSEOErrors'));
37
 
38
+ }
39
  }
 
40
  }
41
 
42
  //Check if Next SEO Goals are active
classes/helpers/Tools.php CHANGED
@@ -347,6 +347,7 @@ class SQ_Classes_Helpers_Tools {
347
  ),
348
 
349
  // dev kit
 
350
  'sq_devkit_logo' => false,
351
  'sq_devkit_name' => false,
352
  'sq_devkit_menu_name' => false,
@@ -932,16 +933,19 @@ class SQ_Classes_Helpers_Tools {
932
  * @return mixed
933
  */
934
  public static function getMenuVisible($key) {
935
- if (!isset(self::$options['menu'][$key])) {
936
- self::$options = self::getOptions();
937
-
938
  if (!isset(self::$options['menu'][$key])) {
939
- self::$options['menu'][$key] = false;
 
 
 
 
940
  }
941
- }
942
 
943
- return apply_filters('sq_menu_visible', self::$options['menu'][$key], $key);
 
944
 
 
945
  }
946
 
947
  /**
347
  ),
348
 
349
  // dev kit
350
+ 'sq_auto_devkit' => 1,
351
  'sq_devkit_logo' => false,
352
  'sq_devkit_name' => false,
353
  'sq_devkit_menu_name' => false,
933
  * @return mixed
934
  */
935
  public static function getMenuVisible($key) {
936
+ if(self::$options['sq_auto_devkit']) {
 
 
937
  if (!isset(self::$options['menu'][$key])) {
938
+ self::$options = self::getOptions();
939
+
940
+ if (!isset(self::$options['menu'][$key])) {
941
+ self::$options['menu'][$key] = false;
942
+ }
943
  }
 
944
 
945
+ return apply_filters('sq_menu_visible', self::$options['menu'][$key], $key);
946
+ }
947
 
948
+ return true;
949
  }
950
 
951
  /**
controllers/Api.php CHANGED
@@ -20,8 +20,9 @@ class SQ_Controllers_Api extends SQ_Classes_FrontController {
20
  return;
21
 
22
  //the default token
23
- if (!SQ_Classes_Helpers_Tools::getOption('sq_cloud_token'))
24
  SQ_Classes_Helpers_Tools::saveOptions('sq_cloud_token', md5(SQ_Classes_Helpers_Tools::getOption('sq_api') . parse_url(home_url(), PHP_URL_HOST)));
 
25
 
26
  $this->token = SQ_Classes_Helpers_Tools::getOption('sq_cloud_token');
27
 
20
  return;
21
 
22
  //the default token
23
+ if (!SQ_Classes_Helpers_Tools::getOption('sq_cloud_token')) {
24
  SQ_Classes_Helpers_Tools::saveOptions('sq_cloud_token', md5(SQ_Classes_Helpers_Tools::getOption('sq_api') . parse_url(home_url(), PHP_URL_HOST)));
25
+ }
26
 
27
  $this->token = SQ_Classes_Helpers_Tools::getOption('sq_cloud_token');
28
 
controllers/Frontend.php CHANGED
@@ -17,6 +17,12 @@ class SQ_Controllers_Frontend extends SQ_Classes_FrontController {
17
  //For favicon and Robots
18
  $this->hookCheckFiles();
19
 
 
 
 
 
 
 
20
  //Check cache plugin compatibility
21
  SQ_Classes_ObjController::getClass('SQ_Models_Compatibility')->checkCompatibility();
22
 
@@ -32,12 +38,6 @@ class SQ_Controllers_Frontend extends SQ_Classes_FrontController {
32
  //Set the post so that Squirrly will know which one to process
33
  add_action('template_redirect', array($this->model, 'setPost'), 9);
34
 
35
- /* Check if sitemap is on and Load the Sitemap */
36
- if (SQ_Classes_Helpers_Tools::getOption('sq_auto_sitemap')) {
37
- add_filter('wp_sitemaps_enabled', '__return_false');
38
- SQ_Classes_ObjController::getClass('SQ_Controllers_Sitemaps');
39
- }
40
-
41
  if(SQ_Classes_Helpers_Tools::getOption('sq_auto_links')) {
42
 
43
  //Check if attachment to image redirect is needed
@@ -103,7 +103,6 @@ class SQ_Controllers_Frontend extends SQ_Classes_FrontController {
103
 
104
  }
105
 
106
-
107
  /**
108
  * Hook the Header load
109
  */
17
  //For favicon and Robots
18
  $this->hookCheckFiles();
19
 
20
+ /* Check if sitemap is on and Load the Sitemap */
21
+ if (SQ_Classes_Helpers_Tools::getOption('sq_auto_sitemap')) {
22
+ add_filter('wp_sitemaps_enabled', '__return_false');
23
+ SQ_Classes_ObjController::getClass('SQ_Controllers_Sitemaps');
24
+ }
25
+
26
  //Check cache plugin compatibility
27
  SQ_Classes_ObjController::getClass('SQ_Models_Compatibility')->checkCompatibility();
28
 
38
  //Set the post so that Squirrly will know which one to process
39
  add_action('template_redirect', array($this->model, 'setPost'), 9);
40
 
 
 
 
 
 
 
41
  if(SQ_Classes_Helpers_Tools::getOption('sq_auto_links')) {
42
 
43
  //Check if attachment to image redirect is needed
103
 
104
  }
105
 
 
106
  /**
107
  * Hook the Header load
108
  */
controllers/Menu.php CHANGED
@@ -136,6 +136,10 @@ class SQ_Controllers_Menu extends SQ_Classes_FrontController {
136
  public function hookTopmenuSquirrly($wp_admin_bar) {
137
  global $tag;
138
 
 
 
 
 
139
  if (is_admin()) {
140
 
141
  if (SQ_Classes_Helpers_Tools::userCan('edit_posts')) {
@@ -256,7 +260,7 @@ class SQ_Controllers_Menu extends SQ_Classes_FrontController {
256
  $wp_meta_boxes['dashboard']['normal']['core'] = array_merge($ours, $dashboard);
257
  }
258
 
259
- public function hookNetworkMenu(){
260
  //Check the Dev Kit settings
261
  SQ_Classes_ObjController::getClass('SQ_Classes_Helpers_DevKit');
262
  }
@@ -315,7 +319,7 @@ class SQ_Controllers_Menu extends SQ_Classes_FrontController {
315
 
316
  //Update the external links in the menu
317
  global $submenu;
318
- if(!empty($submenu['sq_dashboard'])) {
319
  foreach ($submenu['sq_dashboard'] as &$item) {
320
  if (isset($mainmenu[$item[2]]['href']) && $mainmenu[$item[2]]['href']) {
321
  if (parse_url($mainmenu[$item[2]]['href'], PHP_URL_HOST) !== parse_url(home_url(), PHP_URL_HOST)) {
@@ -335,6 +339,10 @@ class SQ_Controllers_Menu extends SQ_Classes_FrontController {
335
  public function addMetabox() {
336
  $types = get_post_types(array('public' => true));
337
 
 
 
 
 
338
  //Exclude types for SLA
339
  $excludes = SQ_Classes_Helpers_Tools::getOption('sq_sla_exclude_post_types');
340
  if (!empty($types) && !empty($excludes)) {
136
  public function hookTopmenuSquirrly($wp_admin_bar) {
137
  global $tag;
138
 
139
+ if (!apply_filters('sq_load_snippet', true) || !SQ_Classes_Helpers_Tools::userCan('sq_manage_snippet')) {
140
+ return;
141
+ }
142
+
143
  if (is_admin()) {
144
 
145
  if (SQ_Classes_Helpers_Tools::userCan('edit_posts')) {
260
  $wp_meta_boxes['dashboard']['normal']['core'] = array_merge($ours, $dashboard);
261
  }
262
 
263
+ public function hookNetworkMenu() {
264
  //Check the Dev Kit settings
265
  SQ_Classes_ObjController::getClass('SQ_Classes_Helpers_DevKit');
266
  }
319
 
320
  //Update the external links in the menu
321
  global $submenu;
322
+ if (!empty($submenu['sq_dashboard'])) {
323
  foreach ($submenu['sq_dashboard'] as &$item) {
324
  if (isset($mainmenu[$item[2]]['href']) && $mainmenu[$item[2]]['href']) {
325
  if (parse_url($mainmenu[$item[2]]['href'], PHP_URL_HOST) !== parse_url(home_url(), PHP_URL_HOST)) {
339
  public function addMetabox() {
340
  $types = get_post_types(array('public' => true));
341
 
342
+ if (!apply_filters('sq_load_snippet', true) || !SQ_Classes_Helpers_Tools::userCan('sq_manage_snippet')) {
343
+ return;
344
+ }
345
+
346
  //Exclude types for SLA
347
  $excludes = SQ_Classes_Helpers_Tools::getOption('sq_sla_exclude_post_types');
348
  if (!empty($types) && !empty($excludes)) {
controllers/PostsList.php CHANGED
@@ -52,6 +52,10 @@ class SQ_Controllers_PostsList extends SQ_Classes_FrontController {
52
  return;
53
  }
54
 
 
 
 
 
55
  foreach ($this->_types as $type) {
56
  add_filter('manage_' . $type . '_columns', array($this, 'add_post_column'), 10, 1);
57
  add_action('manage_' . $type . '_custom_column', array($this, 'add_post_row'), 10, 2);
@@ -102,6 +106,10 @@ class SQ_Controllers_PostsList extends SQ_Classes_FrontController {
102
  $post_type = 'post';
103
  }
104
 
 
 
 
 
105
  if ($column == $this->_slacolumn_id) {
106
  $html = false;
107
  if (SQ_Classes_Helpers_Tools::isAjax()) {
52
  return;
53
  }
54
 
55
+ if (!apply_filters('sq_load_snippet', true) || !SQ_Classes_Helpers_Tools::userCan('sq_manage_snippet')) {
56
+ return;
57
+ }
58
+
59
  foreach ($this->_types as $type) {
60
  add_filter('manage_' . $type . '_columns', array($this, 'add_post_column'), 10, 1);
61
  add_action('manage_' . $type . '_custom_column', array($this, 'add_post_row'), 10, 2);
106
  $post_type = 'post';
107
  }
108
 
109
+ if(!SQ_Classes_Helpers_Tools::userCan('edit_post', $post_id)){
110
+ return;
111
+ }
112
+
113
  if ($column == $this->_slacolumn_id) {
114
  $html = false;
115
  if (SQ_Classes_Helpers_Tools::isAjax()) {
controllers/Snippet.php CHANGED
@@ -86,6 +86,11 @@ class SQ_Controllers_Snippet extends SQ_Classes_FrontController {
86
  * @return string
87
  */
88
  public function getSnippetDiv($content, $attributes = '') {
 
 
 
 
 
89
  return '<div id="sq_blocksnippet" ' . $attributes . ' class="sq_blocksnippet sq-shadow-sm sq-border-bottom sq-mb-4"><h2 class="hndle"><span class="sq_logo" style="margin-right: 5px;width: 30px !important;height: 30px !important;"></span>' . esc_html__("Squirrly SEO Snippet", _SQ_PLUGIN_NAME_) . '</span></h2><div class="inside">' . $content . '</div></div>';
90
 
91
  }
@@ -111,6 +116,10 @@ class SQ_Controllers_Snippet extends SQ_Classes_FrontController {
111
  return;
112
  }
113
 
 
 
 
 
114
  if (!SQ_Classes_Helpers_Tools::userCan('sq_manage_snippets')) {
115
  $current_object = $wp_the_query->get_queried_object();
116
 
86
  * @return string
87
  */
88
  public function getSnippetDiv($content, $attributes = '') {
89
+
90
+ if (!apply_filters('sq_load_snippet', true) || !SQ_Classes_Helpers_Tools::userCan('sq_manage_snippet')) {
91
+ return false;
92
+ }
93
+
94
  return '<div id="sq_blocksnippet" ' . $attributes . ' class="sq_blocksnippet sq-shadow-sm sq-border-bottom sq-mb-4"><h2 class="hndle"><span class="sq_logo" style="margin-right: 5px;width: 30px !important;height: 30px !important;"></span>' . esc_html__("Squirrly SEO Snippet", _SQ_PLUGIN_NAME_) . '</span></h2><div class="inside">' . $content . '</div></div>';
95
 
96
  }
116
  return;
117
  }
118
 
119
+ if (!apply_filters('sq_load_snippet', true) || !SQ_Classes_Helpers_Tools::userCan('sq_manage_snippet')) {
120
+ return;
121
+ }
122
+
123
  if (!SQ_Classes_Helpers_Tools::userCan('sq_manage_snippets')) {
124
  $current_object = $wp_the_query->get_queried_object();
125
 
core/BlockFeatures.php CHANGED
@@ -169,7 +169,7 @@ class SQ_Core_BlockFeatures extends SQ_Classes_BlockController {
169
  ),//Live Assistant Elementor
170
  array(
171
  'title' => "Google Rankings with GSC",
172
- 'description' => "Get <strong>Google Search Console (GSC)</strong> average <strong>possitions, clicks and impressions</strong> for organic keywords.",
173
  'mode' => "Free",
174
  'option' => false,
175
  'active' => true,
169
  ),//Live Assistant Elementor
170
  array(
171
  'title' => "Google Rankings with GSC",
172
+ 'description' => "Get <strong>Google Search Console (GSC)</strong> average <strong>positions, clicks and impressions</strong> for organic keywords.",
173
  'mode' => "Free",
174
  'option' => false,
175
  'active' => true,
models/Compatibility.php CHANGED
@@ -23,6 +23,12 @@ class SQ_Models_Compatibility {
23
  add_filter('sq_lateloading', '__return_true');
24
  }
25
 
 
 
 
 
 
 
26
  //Compatibility with Buddypress Plugin
27
  if (SQ_Classes_Helpers_Tools::isPluginInstalled('buddypress/bp-loader.php')) {
28
  add_filter('sq_lateloading', '__return_true');
@@ -54,6 +60,11 @@ class SQ_Models_Compatibility {
54
  if (SQ_Classes_Helpers_Tools::isPluginInstalled('weglot/weglot.php')) {
55
  add_filter('sq_lateloading', '__return_true');
56
  }
 
 
 
 
 
57
  }
58
 
59
  /**
@@ -96,6 +107,17 @@ class SQ_Models_Compatibility {
96
  return false;
97
  }
98
 
 
 
 
 
 
 
 
 
 
 
 
99
  /**
100
  * Check if there are builders loaded in backend and add compatibility for them
101
  */
23
  add_filter('sq_lateloading', '__return_true');
24
  }
25
 
26
+ //Compatibility with Deep Core PRO plugin
27
+ if (SQ_Classes_Helpers_Tools::isPluginInstalled('deep-core-pro/deep-core-pro.php') &&
28
+ SQ_Classes_Helpers_Tools::isPluginInstalled('js_composer/js_composer.php')) {
29
+ add_action('plugins_loaded', array($this, 'hookDeepPRO'));
30
+ }
31
+
32
  //Compatibility with Buddypress Plugin
33
  if (SQ_Classes_Helpers_Tools::isPluginInstalled('buddypress/bp-loader.php')) {
34
  add_filter('sq_lateloading', '__return_true');
60
  if (SQ_Classes_Helpers_Tools::isPluginInstalled('weglot/weglot.php')) {
61
  add_filter('sq_lateloading', '__return_true');
62
  }
63
+
64
+ //Compatibility with Swis Performance Plugin
65
+ if (defined('SWIS_PLUGIN_VERSION')) {
66
+ add_filter('sq_lateloading', '__return_true');
67
+ }
68
  }
69
 
70
  /**
107
  return false;
108
  }
109
 
110
+ /**
111
+ * Remove the action for WP Bakery shortcodes for Sitemap XML
112
+ */
113
+ public function hookDeepPRO() {
114
+ if (isset($_SERVER['REQUEST_URI'])) {
115
+ if ((isset($_SERVER['QUERY_STRING']) && strpos($_SERVER['QUERY_STRING'], 'sq_feed') !== false) || (strpos($_SERVER['REQUEST_URI'], '.xml') !== false)) {
116
+ remove_action('init', 'shortcodes_init');
117
+ }
118
+ }
119
+ }
120
+
121
  /**
122
  * Check if there are builders loaded in backend and add compatibility for them
123
  */
models/focuspages/Keyword.php CHANGED
@@ -55,11 +55,11 @@ class SQ_Models_Focuspages_Keyword extends SQ_Models_Abstract_Assistant {
55
  // 'value' => (isset($this->_volume->absolute) ? (is_numeric($this->_volume->absolute) ? number_format($this->_volume->absolute, 0, '.', ',') : $this->_volume->absolute) : ''),
56
  // 'description' => sprintf(esc_html__("To turn this task to green, go and find a keyword that has a good search volume. (meaning that many people search on Google for this keyword every single month). %s The Research features from Squirrly SEO will indicate if the volume is big enough. %s Since these are the most important pages on your website, you need to make sure that you get the maximum number of people possible to find this page. %s If you target keyword searches with low volumes, then you'll end up having just 2 or 3 people every month visiting this page. And then all the effort will have been for nothing.", _SQ_PLUGIN_NAME_), '<br /><br />', '<br /><br />', '<br /><br />', '<br /><br />'),
57
  // ),
58
- 'trend' => array(
59
- 'title' => esc_html__("Google Trend", _SQ_PLUGIN_NAME_),
60
- 'value' => ($this->_trend ? $this->_trend->text : false),
61
- 'description' => sprintf(esc_html__("Trend levels required to get the Green Check on this task: %s - Steady %s - Going Up %s - Sky-rocketing %s we take the trend from the previous 3 months. %s If you target a search query with a bad trend you'll end up seeing little traffic to this page in the long run. %s Why ? A declining trend shows that Google Users are losing interest in that topic or keyword and will continue to do so in the future. %s Therefore, even though you could get much traffic right now after you rank this page, in the near future you'll get very little traffic even if you'd end up on Position 1 in Google Search.", _SQ_PLUGIN_NAME_), '<br />', '<br />', '<br />', '<br /><br />', '<br /><br />', '<br /><br />', '<br /><br />'),
62
- ),
63
  );
64
  }
65
 
55
  // 'value' => (isset($this->_volume->absolute) ? (is_numeric($this->_volume->absolute) ? number_format($this->_volume->absolute, 0, '.', ',') : $this->_volume->absolute) : ''),
56
  // 'description' => sprintf(esc_html__("To turn this task to green, go and find a keyword that has a good search volume. (meaning that many people search on Google for this keyword every single month). %s The Research features from Squirrly SEO will indicate if the volume is big enough. %s Since these are the most important pages on your website, you need to make sure that you get the maximum number of people possible to find this page. %s If you target keyword searches with low volumes, then you'll end up having just 2 or 3 people every month visiting this page. And then all the effort will have been for nothing.", _SQ_PLUGIN_NAME_), '<br /><br />', '<br /><br />', '<br /><br />', '<br /><br />'),
57
  // ),
58
+ // 'trend' => array(
59
+ // 'title' => esc_html__("Google Trend", _SQ_PLUGIN_NAME_),
60
+ // 'value' => ($this->_trend ? $this->_trend->text : false),
61
+ // 'description' => sprintf(esc_html__("Trend levels required to get the Green Check on this task: %s - Steady %s - Going Up %s - Sky-rocketing %s we take the trend from the previous 3 months. %s If you target a search query with a bad trend you'll end up seeing little traffic to this page in the long run. %s Why ? A declining trend shows that Google Users are losing interest in that topic or keyword and will continue to do so in the future. %s Therefore, even though you could get much traffic right now after you rank this page, in the near future you'll get very little traffic even if you'd end up on Position 1 in Google Search.", _SQ_PLUGIN_NAME_), '<br />', '<br />', '<br />', '<br /><br />', '<br /><br />', '<br /><br />', '<br /><br />'),
62
+ // ),
63
  );
64
  }
65
 
readme.txt CHANGED
@@ -400,6 +400,22 @@ Type a keyword to the right of the screen and start using Squirrly Seo. Enjoy!
400
  9. Squirrly SEO - Progress & Achievements
401
 
402
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
403
  = 11.1.04- 05/27/2021 =
404
  Update - Add the Multilingual Support option for non UTF8 encodings
405
  Update - Compatibility with Weglot plugin
400
  9. Squirrly SEO - Progress & Achievements
401
 
402
  == Changelog ==
403
+ = 11.1.05- 06/22/2021 =
404
+ Update - Compatibility with Oxygen Gutenberg plugin
405
+ Update - Let Visibility setup in SEO Snippet while WordPress is in "Discourage Search Engines from Indexing this Site"
406
+ Update - Remove the Memory Limit option in Squirrly SEO
407
+ Update - Automatically add 'noindex' to empty Tags and Categories
408
+ Update - Added option to exclude from Sitemap the noindex pages
409
+ Update - Added new Social button patterns in SEO Audit to identify Social Share buttons
410
+ Fix - Word count in Focus Pages for some Page Builders like Divi, WP Bakery
411
+ Fix - Timeout while doing Keywords backup from Briefcase
412
+ Fix - Prevent Posts and Pages duplicate in Sitemap XML while WPML plugin is active
413
+ Fix - Correct the Categories SEO Import from Rank Math
414
+ Fix - Hide Features from All Features when they are deactivated in Dev Kit
415
+ Fix - Slug change support for Quick Edit while in Post List
416
+ Fix - Remove the error count notification when the Next SEO Goals are hidden
417
+ Fix - Pattern replace with case insensitive {{Title}} = {{title}}
418
+
419
  = 11.1.04- 05/27/2021 =
420
  Update - Add the Multilingual Support option for non UTF8 encodings
421
  Update - Compatibility with Weglot plugin
squirrly.php CHANGED
@@ -8,7 +8,7 @@
8
  * Description: A.I.-based Private SEO Consultant. In a Plugin. Powered by Machine Learning and Cloud Services. Over 300 functionalities for SEO available when you need them.
9
  * Author: Squirrly SEO
10
  * Author URI: https://plugin.squirrly.co
11
- * Version: 11.1.04
12
  * License: GPLv2 or later
13
  * License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
14
  * Text Domain: squirrly-seo
@@ -17,9 +17,9 @@
17
 
18
  if (!defined('SQ_VERSION')) {
19
  /* SET THE CURRENT VERSION ABOVE AND BELOW */
20
- define('SQ_VERSION', '11.1.04');
21
  //The last stable version
22
- define('SQ_STABLE_VERSION', '11.1.03');
23
  // Call config files
24
  try {
25
  require_once(dirname(__FILE__) . '/config/config.php');
8
  * Description: A.I.-based Private SEO Consultant. In a Plugin. Powered by Machine Learning and Cloud Services. Over 300 functionalities for SEO available when you need them.
9
  * Author: Squirrly SEO
10
  * Author URI: https://plugin.squirrly.co
11
+ * Version: 11.1.05
12
  * License: GPLv2 or later
13
  * License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
14
  * Text Domain: squirrly-seo
17
 
18
  if (!defined('SQ_VERSION')) {
19
  /* SET THE CURRENT VERSION ABOVE AND BELOW */
20
+ define('SQ_VERSION', '11.1.05');
21
  //The last stable version
22
+ define('SQ_STABLE_VERSION', '11.1.04');
23
  // Call config files
24
  try {
25
  require_once(dirname(__FILE__) . '/config/config.php');
view/Assistant/Assistant.php CHANGED
@@ -3,6 +3,12 @@
3
  <?php SQ_Classes_ObjController::getClass('SQ_Core_BlockToolbar')->init(); ?>
4
  <?php do_action('sq_notices'); ?>
5
  <div class="d-flex flex-row my-0 bg-white" style="clear: both !important;">
 
 
 
 
 
 
6
  <?php echo SQ_Classes_ObjController::getClass('SQ_Models_Menu')->getAdminTabs(SQ_Classes_Helpers_Tools::getValue('tab', 'assistant'), 'sq_assistant'); ?>
7
  <div class="d-flex flex-row flex-nowrap flex-grow-1 bg-white px-1 m-0">
8
  <div class="flex-grow-1 px-1 sq_flex">
3
  <?php SQ_Classes_ObjController::getClass('SQ_Core_BlockToolbar')->init(); ?>
4
  <?php do_action('sq_notices'); ?>
5
  <div class="d-flex flex-row my-0 bg-white" style="clear: both !important;">
6
+ <?php
7
+ if (!apply_filters('sq_load_snippet', true) || !SQ_Classes_Helpers_Tools::userCan('sq_manage_snippet')) {
8
+ echo '<div class="col-12 alert alert-success text-center m-0 p-3">' . esc_html__("You do not have permission to access this page. You need Squirrly SEO Editor role.", _SQ_PLUGIN_NAME_) . '</div>';
9
+ return;
10
+ }
11
+ ?>
12
  <?php echo SQ_Classes_ObjController::getClass('SQ_Models_Menu')->getAdminTabs(SQ_Classes_Helpers_Tools::getValue('tab', 'assistant'), 'sq_assistant'); ?>
13
  <div class="d-flex flex-row flex-nowrap flex-grow-1 bg-white px-1 m-0">
14
  <div class="flex-grow-1 px-1 sq_flex">
view/Blocks/Connect.php CHANGED
@@ -13,7 +13,7 @@
13
  <i class="fa fa-check" title="ssss" data-original-title=""></i>
14
  <div class="message" style="display: none"></div>
15
  <div class="description" style="display: none"><?php echo sprintf(esc_html__("This option is used to track innerlinks and insights for your Focus Pages and give detailed information about them. %sIt is also useful for sending the optimized posts from %shttps://cloud.squirrly.co%s directly on your WordPress site.", _SQ_PLUGIN_NAME_), '<br /> ', '<a href="https://cloud.squirrly.co" target="_blank">', '</a>'); ?></div>
16
- <h4><?php echo esc_html__("Let Squirrly Cloud get data for Focus Pages", _SQ_PLUGIN_NAME_); ?></h4>
17
  </li>
18
  <div class="text-center m-0 mb-3">
19
  <button type="submit" class="btn btn-primary btn-sm inline p-0 px-3 m-0" style="z-index: 1"><?php echo esc_html__("Connect", _SQ_PLUGIN_NAME_); ?></button>
@@ -28,7 +28,7 @@
28
  <div class="message" style="display: none"></div>
29
  <div class="description" style="display: none"><?php echo sprintf(esc_html__("This option is used to track innerlinks and insights for your Focus Pages and give detailed information about them. %sIt is also useful for sending the optimized posts from %shttps://cloud.squirrly.co%s directly on your WordPress site.", _SQ_PLUGIN_NAME_), '<br /> ', '<a href="https://cloud.squirrly.co" target="_blank">', '</a>'); ?></div>
30
  <h4>
31
- <?php echo esc_html__("Let Squirrly Cloud connect to WordPress API", _SQ_PLUGIN_NAME_); ?>
32
  </h4>
33
  </li>
34
  <div class="text-center m-0 mb-3">
13
  <i class="fa fa-check" title="ssss" data-original-title=""></i>
14
  <div class="message" style="display: none"></div>
15
  <div class="description" style="display: none"><?php echo sprintf(esc_html__("This option is used to track innerlinks and insights for your Focus Pages and give detailed information about them. %sIt is also useful for sending the optimized posts from %shttps://cloud.squirrly.co%s directly on your WordPress site.", _SQ_PLUGIN_NAME_), '<br /> ', '<a href="https://cloud.squirrly.co" target="_blank">', '</a>'); ?></div>
16
+ <h4><?php echo esc_html__("Connect Squirrly Cloud & Website API", _SQ_PLUGIN_NAME_); ?></h4>
17
  </li>
18
  <div class="text-center m-0 mb-3">
19
  <button type="submit" class="btn btn-primary btn-sm inline p-0 px-3 m-0" style="z-index: 1"><?php echo esc_html__("Connect", _SQ_PLUGIN_NAME_); ?></button>
28
  <div class="message" style="display: none"></div>
29
  <div class="description" style="display: none"><?php echo sprintf(esc_html__("This option is used to track innerlinks and insights for your Focus Pages and give detailed information about them. %sIt is also useful for sending the optimized posts from %shttps://cloud.squirrly.co%s directly on your WordPress site.", _SQ_PLUGIN_NAME_), '<br /> ', '<a href="https://cloud.squirrly.co" target="_blank">', '</a>'); ?></div>
30
  <h4>
31
+ <?php echo esc_html__("Connect Squirrly Cloud & Website API", _SQ_PLUGIN_NAME_); ?>
32
  </h4>
33
  </li>
34
  <div class="text-center m-0 mb-3">
view/Blocks/SLASeo.php CHANGED
@@ -33,7 +33,6 @@
33
  <li class="sq_tasks_category" style="width: 100%; box-shadow: none !important; padding: 0; margin: 0; margin-bottom: -14px !important; line-height: 1px;">
34
  <progress class="sq_blockseo_progress" max="100" value="0"></progress>
35
  </li>
36
- <script>jQuery("body").prepend('<progress class="sq_blockseo_topprogress" max="100" value="0"></progress>')</script>
37
  </ul>
38
  </div>
39
  </div>
33
  <li class="sq_tasks_category" style="width: 100%; box-shadow: none !important; padding: 0; margin: 0; margin-bottom: -14px !important; line-height: 1px;">
34
  <progress class="sq_blockseo_progress" max="100" value="0"></progress>
35
  </li>
 
36
  </ul>
37
  </div>
38
  </div>
view/BulkSeo/Bulkseo.php CHANGED
@@ -9,8 +9,8 @@
9
 
10
  <div class="d-flex flex-row my-0 bg-white" style="clear: both !important;">
11
  <?php
12
- if (!SQ_Classes_Helpers_Tools::userCan('sq_manage_snippet')) {
13
- echo '<div class="col-12 alert alert-success text-center m-0 p-3">' . esc_html__("You do not have permission to access this page. You need Squirrly SEO Admin role.", _SQ_PLUGIN_NAME_) . '</div>';
14
  return;
15
  }
16
  ?>
9
 
10
  <div class="d-flex flex-row my-0 bg-white" style="clear: both !important;">
11
  <?php
12
+ if (!apply_filters('sq_load_snippet', true) || !SQ_Classes_Helpers_Tools::userCan('sq_manage_snippet')) {
13
+ echo '<div class="col-12 alert alert-success text-center m-0 p-3">' . esc_html__("You do not have permission to access this page. You need Squirrly SEO Editor role.", _SQ_PLUGIN_NAME_) . '</div>';
14
  return;
15
  }
16
  ?>
view/Ranking/Rankings.php CHANGED
@@ -37,7 +37,7 @@ echo (string)$view->getScripts();
37
  <?php if ($view->checkin->subscription_serpcheck) { ?>
38
  <div class="card-title-description m-2"><?php echo esc_html__("It's a fully functional SEO Ranking Tool that helps you find the true position of your website in Google for any keyword and any country you want", _SQ_PLUGIN_NAME_); ?></div>
39
  <?php } else { ?>
40
- <div class="card-title-description m-2"><?php echo esc_html__("Get the Google Search Console average possitions, clicks and impressions for all organic keywords of your website.", _SQ_PLUGIN_NAME_); ?></div>
41
  <?php } ?>
42
  </div>
43
 
37
  <?php if ($view->checkin->subscription_serpcheck) { ?>
38
  <div class="card-title-description m-2"><?php echo esc_html__("It's a fully functional SEO Ranking Tool that helps you find the true position of your website in Google for any keyword and any country you want", _SQ_PLUGIN_NAME_); ?></div>
39
  <?php } else { ?>
40
+ <div class="card-title-description m-2"><?php echo esc_html__("Get the Google Search Console average positions, clicks and impressions for all organic keywords of your website.", _SQ_PLUGIN_NAME_); ?></div>
41
  <?php } ?>
42
  </div>
43
 
view/Research/Briefcase.php CHANGED
@@ -3,6 +3,12 @@
3
  <?php SQ_Classes_ObjController::getClass('SQ_Core_BlockToolbar')->init(); ?>
4
  <?php do_action('sq_notices'); ?>
5
  <div class="d-flex flex-row my-0 bg-white" style="clear: both !important;">
 
 
 
 
 
 
6
  <?php echo SQ_Classes_ObjController::getClass('SQ_Models_Menu')->getAdminTabs(SQ_Classes_Helpers_Tools::getValue('tab', 'briefcase'), 'sq_research'); ?>
7
  <div class="d-flex flex-row flex-nowrap flex-grow-1 bg-white px-1 m-0">
8
  <div class="flex-grow-1 px-1 sq_flex">
@@ -344,34 +350,6 @@
344
  <div class="col-6"><?php echo($row->research->tw->text <> '' ? $view->getReasearchStatsText('tw',$row->research->tw->value) : '-') ?></div>
345
  </li>
346
  <?php } ?>
347
- <?php if (isset($row->research->td)) { ?>
348
- <li class="row py-3">
349
- <div class="col-4"><?php echo esc_html__("Trending", _SQ_PLUGIN_NAME_) ?>:</div>
350
- <div class="col-6">
351
- <?php if (isset($row->research->td->absolute) && is_array($row->research->td->absolute) && !empty($row->research->td->absolute)) {
352
- $last = 0.1;
353
- $datachar = [];
354
- foreach ($row->research->td->absolute as $td) {
355
- if ((float)$td > 0) {
356
- $datachar[] = $td;
357
- $last = $td;
358
- } else {
359
- $datachar[] = $last;
360
- }
361
- }
362
- if (!empty($datachar)) {
363
- $row->research->td->absolute = array_splice($datachar, -7);
364
- }
365
- } else {
366
- $row->research->td->absolute = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1];
367
- }
368
- ?>
369
- <div style="width: 60px;height: 30px;">
370
- <canvas id="sq_trend<?php echo (int)$key; ?>" class="sq_trend" data-values="<?php echo join(',', (array)$row->research->td->absolute) ?>"></canvas>
371
- </div>
372
- </div>
373
- </li>
374
- <?php } ?>
375
  </ul>
376
  </div>
377
 
3
  <?php SQ_Classes_ObjController::getClass('SQ_Core_BlockToolbar')->init(); ?>
4
  <?php do_action('sq_notices'); ?>
5
  <div class="d-flex flex-row my-0 bg-white" style="clear: both !important;">
6
+ <?php
7
+ if (!apply_filters('sq_load_snippet', true) || !SQ_Classes_Helpers_Tools::userCan('sq_manage_snippet')) {
8
+ echo '<div class="col-12 alert alert-success text-center m-0 p-3">' . esc_html__("You do not have permission to access this page. You need Squirrly SEO Editor role.", _SQ_PLUGIN_NAME_) . '</div>';
9
+ return;
10
+ }
11
+ ?>
12
  <?php echo SQ_Classes_ObjController::getClass('SQ_Models_Menu')->getAdminTabs(SQ_Classes_Helpers_Tools::getValue('tab', 'briefcase'), 'sq_research'); ?>
13
  <div class="d-flex flex-row flex-nowrap flex-grow-1 bg-white px-1 m-0">
14
  <div class="flex-grow-1 px-1 sq_flex">
350
  <div class="col-6"><?php echo($row->research->tw->text <> '' ? $view->getReasearchStatsText('tw',$row->research->tw->value) : '-') ?></div>
351
  </li>
352
  <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353
  </ul>
354
  </div>
355
 
view/Research/History.php CHANGED
@@ -3,6 +3,12 @@
3
  <?php SQ_Classes_ObjController::getClass('SQ_Core_BlockToolbar')->init(); ?>
4
  <?php do_action('sq_notices'); ?>
5
  <div class="d-flex flex-row my-0 bg-white" style="clear: both !important;">
 
 
 
 
 
 
6
  <?php echo SQ_Classes_ObjController::getClass('SQ_Models_Menu')->getAdminTabs(SQ_Classes_Helpers_Tools::getValue('tab', 'suggested'), 'sq_research'); ?>
7
  <div class="d-flex flex-row flex-nowrap flex-grow-1 bg-white px-1 m-0">
8
  <div class="flex-grow-1 px-1 sq_flex">
3
  <?php SQ_Classes_ObjController::getClass('SQ_Core_BlockToolbar')->init(); ?>
4
  <?php do_action('sq_notices'); ?>
5
  <div class="d-flex flex-row my-0 bg-white" style="clear: both !important;">
6
+ <?php
7
+ if (!apply_filters('sq_load_snippet', true) || !SQ_Classes_Helpers_Tools::userCan('sq_manage_snippet')) {
8
+ echo '<div class="col-12 alert alert-success text-center m-0 p-3">' . esc_html__("You do not have permission to access this page. You need Squirrly SEO Editor role.", _SQ_PLUGIN_NAME_) . '</div>';
9
+ return;
10
+ }
11
+ ?>
12
  <?php echo SQ_Classes_ObjController::getClass('SQ_Models_Menu')->getAdminTabs(SQ_Classes_Helpers_Tools::getValue('tab', 'suggested'), 'sq_research'); ?>
13
  <div class="d-flex flex-row flex-nowrap flex-grow-1 bg-white px-1 m-0">
14
  <div class="flex-grow-1 px-1 sq_flex">
view/Research/HistoryDetails.php CHANGED
@@ -18,10 +18,7 @@
18
  <i class="fa fa-users"></i>
19
  <?php echo esc_html__("Discussion", _SQ_PLUGIN_NAME_) ?>
20
  </th>
21
- <th title="<?php echo esc_html__("Trending", _SQ_PLUGIN_NAME_) ?>">
22
- <i class="fa fa-bar-chart"></i>
23
- <?php echo esc_html__("Trend", _SQ_PLUGIN_NAME_) ?>
24
- </th>
25
  <th></th>
26
  </tr>
27
  </thead>
@@ -46,26 +43,19 @@
46
  <tr class="<?php echo($in_briefcase ? 'bg-briefcase' : '') ?> " >
47
  <td nowrap="nowrap" style="width: 40%;"><?php echo esc_html($row->keyword) ?></td>
48
  <?php if (!empty($row->stats)) { ?>
49
- <td nowrap="nowrap" style="width: 20%;">
50
  <span class="sq_top_keywords_rank" style="color:<?php echo(isset($row->stats->sc->color) ? esc_attr($row->stats->sc->color) : '#fff') ?>"><?php echo(isset($row->stats->sc->text) ? $view->getReasearchStatsText('sc',$row->stats->sc->value) : '-') ?></span>
51
  </td>
52
- <td nowrap="nowrap text-right" style="width: 15%;">
53
  <span class="sq_top_keywords_rank"><?php echo(isset($row->stats->sv->absolute) ? (is_numeric($row->stats->sv->absolute) ? number_format($row->stats->sv->absolute, 0, '.', ',') : esc_html($row->stats->sv->absolute)) : '-') ?></span>
54
  </td>
55
- <td nowrap="nowrap" style="width: 15%;">
56
  <span class="sq_top_keywords_rank"><?php echo(isset($row->stats->tw->text) ? $view->getReasearchStatsText('tw',$row->stats->tw->value) : '-') ?></span>
57
  </td>
58
-
59
- <td nowrap="nowrap" style="width: 0.5%;">
60
- <div style="width: 60px;height: 30px;">
61
- <canvas class="sq_trend" data-values=" <?php echo join(',', (array)$row->stats->td->absolute) ?>"></canvas>
62
- </div>
63
- </td>
64
  <?php } else { ?>
65
  <td></td>
66
  <td></td>
67
  <td></td>
68
- <td></td>
69
  <?php } ?>
70
  <td class="px-0 py-2" style="width: 20px">
71
  <div class="sq_sm_menu">
18
  <i class="fa fa-users"></i>
19
  <?php echo esc_html__("Discussion", _SQ_PLUGIN_NAME_) ?>
20
  </th>
21
+
 
 
 
22
  <th></th>
23
  </tr>
24
  </thead>
43
  <tr class="<?php echo($in_briefcase ? 'bg-briefcase' : '') ?> " >
44
  <td nowrap="nowrap" style="width: 40%;"><?php echo esc_html($row->keyword) ?></td>
45
  <?php if (!empty($row->stats)) { ?>
46
+ <td nowrap="nowrap" style="width: 25%;">
47
  <span class="sq_top_keywords_rank" style="color:<?php echo(isset($row->stats->sc->color) ? esc_attr($row->stats->sc->color) : '#fff') ?>"><?php echo(isset($row->stats->sc->text) ? $view->getReasearchStatsText('sc',$row->stats->sc->value) : '-') ?></span>
48
  </td>
49
+ <td nowrap="nowrap text-right" style="width: 16%;">
50
  <span class="sq_top_keywords_rank"><?php echo(isset($row->stats->sv->absolute) ? (is_numeric($row->stats->sv->absolute) ? number_format($row->stats->sv->absolute, 0, '.', ',') : esc_html($row->stats->sv->absolute)) : '-') ?></span>
51
  </td>
52
+ <td nowrap="nowrap" style="width: 17%;">
53
  <span class="sq_top_keywords_rank"><?php echo(isset($row->stats->tw->text) ? $view->getReasearchStatsText('tw',$row->stats->tw->value) : '-') ?></span>
54
  </td>
 
 
 
 
 
 
55
  <?php } else { ?>
56
  <td></td>
57
  <td></td>
58
  <td></td>
 
59
  <?php } ?>
60
  <td class="px-0 py-2" style="width: 20px">
61
  <div class="sq_sm_menu">
view/Research/Labels.php CHANGED
@@ -3,6 +3,12 @@
3
  <?php SQ_Classes_ObjController::getClass('SQ_Core_BlockToolbar')->init(); ?>
4
  <?php do_action('sq_notices'); ?>
5
  <div class="d-flex flex-row my-0 bg-white" style="clear: both !important;">
 
 
 
 
 
 
6
  <?php echo SQ_Classes_ObjController::getClass('SQ_Models_Menu')->getAdminTabs(SQ_Classes_Helpers_Tools::getValue('tab', 'labels'), 'sq_research'); ?>
7
  <div class="d-flex flex-row flex-nowrap flex-grow-1 bg-white px-1 m-0">
8
  <div class="flex-grow-1 px-1 sq_flex">
3
  <?php SQ_Classes_ObjController::getClass('SQ_Core_BlockToolbar')->init(); ?>
4
  <?php do_action('sq_notices'); ?>
5
  <div class="d-flex flex-row my-0 bg-white" style="clear: both !important;">
6
+ <?php
7
+ if (!apply_filters('sq_load_snippet', true) || !SQ_Classes_Helpers_Tools::userCan('sq_manage_snippet')) {
8
+ echo '<div class="col-12 alert alert-success text-center m-0 p-3">' . esc_html__("You do not have permission to access this page. You need Squirrly SEO Editor role.", _SQ_PLUGIN_NAME_) . '</div>';
9
+ return;
10
+ }
11
+ ?>
12
  <?php echo SQ_Classes_ObjController::getClass('SQ_Models_Menu')->getAdminTabs(SQ_Classes_Helpers_Tools::getValue('tab', 'labels'), 'sq_research'); ?>
13
  <div class="d-flex flex-row flex-nowrap flex-grow-1 bg-white px-1 m-0">
14
  <div class="flex-grow-1 px-1 sq_flex">
view/Research/Research.php CHANGED
@@ -3,6 +3,12 @@
3
  <?php SQ_Classes_ObjController::getClass('SQ_Core_BlockToolbar')->init(); ?>
4
  <?php do_action('sq_notices'); ?>
5
  <div class="d-flex flex-row my-0 bg-white" style="clear: both !important;">
 
 
 
 
 
 
6
  <?php echo SQ_Classes_ObjController::getClass('SQ_Models_Menu')->getAdminTabs(SQ_Classes_Helpers_Tools::getValue('tab', 'research'), 'sq_research'); ?>
7
  <div class="d-flex flex-row flex-nowrap flex-grow-1 bg-white px-1 m-0">
8
  <div class="flex-grow-1 px-1 sq_flex">
@@ -213,10 +219,6 @@
213
  <i class="fa fa-comments-o" title="<?php echo esc_html__("Recent discussions", _SQ_PLUGIN_NAME_) ?>"></i>
214
  <?php echo esc_html__("Discussion", _SQ_PLUGIN_NAME_) ?>
215
  </th>
216
- <th>
217
- <i class="fa fa-bar-chart" title="<?php echo esc_html__("Trending", _SQ_PLUGIN_NAME_) ?>"></i>
218
- <?php echo esc_html__("Trend", _SQ_PLUGIN_NAME_) ?>
219
- </th>
220
  <th></th>
221
  </tr>
222
  </thead>
3
  <?php SQ_Classes_ObjController::getClass('SQ_Core_BlockToolbar')->init(); ?>
4
  <?php do_action('sq_notices'); ?>
5
  <div class="d-flex flex-row my-0 bg-white" style="clear: both !important;">
6
+ <?php
7
+ if (!apply_filters('sq_load_snippet', true) || !SQ_Classes_Helpers_Tools::userCan('sq_manage_snippet')) {
8
+ echo '<div class="col-12 alert alert-success text-center m-0 p-3">' . esc_html__("You do not have permission to access this page. You need Squirrly SEO Editor role.", _SQ_PLUGIN_NAME_) . '</div>';
9
+ return;
10
+ }
11
+ ?>
12
  <?php echo SQ_Classes_ObjController::getClass('SQ_Models_Menu')->getAdminTabs(SQ_Classes_Helpers_Tools::getValue('tab', 'research'), 'sq_research'); ?>
13
  <div class="d-flex flex-row flex-nowrap flex-grow-1 bg-white px-1 m-0">
14
  <div class="flex-grow-1 px-1 sq_flex">
219
  <i class="fa fa-comments-o" title="<?php echo esc_html__("Recent discussions", _SQ_PLUGIN_NAME_) ?>"></i>
220
  <?php echo esc_html__("Discussion", _SQ_PLUGIN_NAME_) ?>
221
  </th>
 
 
 
 
222
  <th></th>
223
  </tr>
224
  </thead>
view/Research/ResearchDetails.php CHANGED
@@ -20,18 +20,12 @@ if (!empty($view->kr)) {
20
  }
21
  ?>
22
  <tr class="<?php echo($in_briefcase ? 'bg-briefcase' : '') ?> <?php echo($row->initial ? 'bg-selected' : '') ?>">
23
- <td style="width: 33%;"><?php echo(isset($row->keyword) ? SQ_Classes_Helpers_Sanitize::escapeKeyword($row->keyword) : '') ?></td>
24
- <td style="width: 1%;"><?php echo(isset($view->country) ? esc_html($view->country) : 'com') ?></td>
25
- <td style="width: 20%; color: <?php echo esc_attr($row->stats->sc->color) ?>"><?php echo(isset($row->stats->sc->text) ? '<span data-value="' . esc_attr($row->stats->sc->value) . '">' . $view->getReasearchStatsText('sc',$row->stats->sc->value) . '</span>' : '') ?></td>
26
- <td style="width: 13%"><?php echo(isset($row->stats->sv) ? '<span data-value="' . (int)$row->stats->sv->absolute . '">' . (is_numeric($row->stats->sv->absolute) ? number_format($row->stats->sv->absolute, 0, '.', ',') . '</span>' : esc_html($row->stats->sv->absolute)) : '') ?></td>
27
- <td style="width: 15%;"><?php echo(isset($row->stats->tw) ? '<span data-value="' . esc_attr($row->stats->tw->value) . '">' . $view->getReasearchStatsText('tw',$row->stats->tw->value) . '</span>' : '') ?></td>
28
- <td style="width: 12%;">
29
- <?php if (isset($row->stats->td)) { ?>
30
- <div style="width: 60px; height: 30px;">
31
- <canvas class="sq_trend" data-values=" <?php echo join(',', (array)$row->stats->td->absolute) ?>"></canvas>
32
- </div>
33
- <?php } ?>
34
- </td>
35
  <td class="px-0" style="width: 24px;">
36
  <div class="sq_sm_menu">
37
  <div class="sm_icon_button sm_icon_options">
20
  }
21
  ?>
22
  <tr class="<?php echo($in_briefcase ? 'bg-briefcase' : '') ?> <?php echo($row->initial ? 'bg-selected' : '') ?>">
23
+ <td style="width: 40%;"><?php echo(isset($row->keyword) ? SQ_Classes_Helpers_Sanitize::escapeKeyword($row->keyword) : '') ?></td>
24
+ <td style="width: 4%;"><?php echo(isset($view->country) ? esc_html($view->country) : 'com') ?></td>
25
+ <td style="width: 23%; color: <?php echo esc_attr($row->stats->sc->color) ?>"><?php echo(isset($row->stats->sc->text) ? '<span data-value="' . esc_attr($row->stats->sc->value) . '">' . $view->getReasearchStatsText('sc',$row->stats->sc->value) . '</span>' : '') ?></td>
26
+ <td style="width: 16%"><?php echo(isset($row->stats->sv) ? '<span data-value="' . (int)$row->stats->sv->absolute . '">' . (is_numeric($row->stats->sv->absolute) ? number_format($row->stats->sv->absolute, 0, '.', ',') . '</span>' : esc_html($row->stats->sv->absolute)) : '') ?></td>
27
+ <td style="width: 17%;"><?php echo(isset($row->stats->tw) ? '<span data-value="' . esc_attr($row->stats->tw->value) . '">' . $view->getReasearchStatsText('tw',$row->stats->tw->value) . '</span>' : '') ?></td>
28
+
 
 
 
 
 
 
29
  <td class="px-0" style="width: 24px;">
30
  <div class="sq_sm_menu">
31
  <div class="sm_icon_button sm_icon_options">
view/Research/Suggested.php CHANGED
@@ -3,6 +3,12 @@
3
  <?php SQ_Classes_ObjController::getClass('SQ_Core_BlockToolbar')->init(); ?>
4
  <?php do_action('sq_notices'); ?>
5
  <div class="d-flex flex-row my-0 bg-white" style="clear: both !important;">
 
 
 
 
 
 
6
  <?php echo SQ_Classes_ObjController::getClass('SQ_Models_Menu')->getAdminTabs(SQ_Classes_Helpers_Tools::getValue('tab', 'suggested'), 'sq_research'); ?>
7
  <div class="d-flex flex-row flex-nowrap flex-grow-1 bg-white px-1 m-0">
8
  <div class="flex-grow-1 px-1 sq_flex">
@@ -44,10 +50,6 @@
44
  <i class="fa fa-comments-o" title="<?php echo esc_html__("Recent discussions", _SQ_PLUGIN_NAME_) ?>"></i>
45
  <?php echo esc_html__("Discussion", _SQ_PLUGIN_NAME_) ?>
46
  </th>
47
- <th style="width: 100px;">
48
- <i class="fa fa-bar-chart" title="<?php echo esc_html__("Trending", _SQ_PLUGIN_NAME_) ?>"></i>
49
- <?php echo esc_html__("Trend", _SQ_PLUGIN_NAME_) ?>
50
- </th>
51
  <th style="width: 20px;"></th>
52
  </tr>
53
  </thead>
@@ -84,33 +86,6 @@
84
  <td style="width: 20%; color: <?php echo esc_attr($research->sc->color) ?>"><?php echo(isset($research->sc->text) ? '<span data-value="' . esc_attr($research->sc->value) . '">' . $view->getReasearchStatsText('sc',$research->sc->value) . '</span>' : '') ?></td>
85
  <td style="width: 13%; "><?php echo(isset($research->sv) ? '<span data-value="' . (int)$research->sv->absolute . '">' . (is_numeric($research->sv->absolute) ? number_format($research->sv->absolute, 0, '.', ',') . '</span>' : esc_html($research->sv->absolute)) : '') ?></td>
86
  <td style="width: 15%; "><?php echo(isset($research->tw) ? '<span data-value="' . esc_attr($research->tw->value) . '">' . $view->getReasearchStatsText('tw',$research->tw->value) . '</span>' : '') ?></td>
87
- <td style="width: 100px;">
88
- <?php if (isset($research->td)) { ?>
89
- <?php
90
- if (isset($research->td->absolute) && is_array($research->td->absolute) && !empty($research->td->absolute)) {
91
- $last = 0.1;
92
- $datachar = [];
93
- foreach ($research->td->absolute as $td) {
94
- if ((float)$td > 0) {
95
- $datachar[] = $td;
96
- $last = $td;
97
- } else {
98
- $datachar[] = $last;
99
- }
100
- }
101
- if (!empty($datachar)) {
102
- $research->td->absolute = array_splice($datachar, -7);
103
- }
104
- } else {
105
- $research->td->absolute = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1];
106
- }
107
- ?>
108
- <div style="width: 60px;height: 30px;">
109
- <canvas class="sq_trend" data-values="<?php echo join(',', $research->td->absolute) ?>"></canvas>
110
- </div>
111
-
112
- <?php } ?>
113
- </td>
114
  <td class="px-0 py-2" style="width: 20px">
115
  <div class="sq_sm_menu">
116
  <div class="sm_icon_button sm_icon_options">
3
  <?php SQ_Classes_ObjController::getClass('SQ_Core_BlockToolbar')->init(); ?>
4
  <?php do_action('sq_notices'); ?>
5
  <div class="d-flex flex-row my-0 bg-white" style="clear: both !important;">
6
+ <?php
7
+ if (!apply_filters('sq_load_snippet', true) || !SQ_Classes_Helpers_Tools::userCan('sq_manage_snippet')) {
8
+ echo '<div class="col-12 alert alert-success text-center m-0 p-3">' . esc_html__("You do not have permission to access this page. You need Squirrly SEO Editor role.", _SQ_PLUGIN_NAME_) . '</div>';
9
+ return;
10
+ }
11
+ ?>
12
  <?php echo SQ_Classes_ObjController::getClass('SQ_Models_Menu')->getAdminTabs(SQ_Classes_Helpers_Tools::getValue('tab', 'suggested'), 'sq_research'); ?>
13
  <div class="d-flex flex-row flex-nowrap flex-grow-1 bg-white px-1 m-0">
14
  <div class="flex-grow-1 px-1 sq_flex">
50
  <i class="fa fa-comments-o" title="<?php echo esc_html__("Recent discussions", _SQ_PLUGIN_NAME_) ?>"></i>
51
  <?php echo esc_html__("Discussion", _SQ_PLUGIN_NAME_) ?>
52
  </th>
 
 
 
 
53
  <th style="width: 20px;"></th>
54
  </tr>
55
  </thead>
86
  <td style="width: 20%; color: <?php echo esc_attr($research->sc->color) ?>"><?php echo(isset($research->sc->text) ? '<span data-value="' . esc_attr($research->sc->value) . '">' . $view->getReasearchStatsText('sc',$research->sc->value) . '</span>' : '') ?></td>
87
  <td style="width: 13%; "><?php echo(isset($research->sv) ? '<span data-value="' . (int)$research->sv->absolute . '">' . (is_numeric($research->sv->absolute) ? number_format($research->sv->absolute, 0, '.', ',') . '</span>' : esc_html($research->sv->absolute)) : '') ?></td>
88
  <td style="width: 15%; "><?php echo(isset($research->tw) ? '<span data-value="' . esc_attr($research->tw->value) . '">' . $view->getReasearchStatsText('tw',$research->tw->value) . '</span>' : '') ?></td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  <td class="px-0 py-2" style="width: 20px">
90
  <div class="sq_sm_menu">
91
  <div class="sm_icon_button sm_icon_options">
view/assets/js/global.min.js CHANGED
@@ -1 +1 @@
1
- if(typeof SQ_DEBUG==="undefined")var SQ_DEBUG=false;(function($){"use strict";$.sq_setCookie=function(name,value){value=value.toString().replace(new RegExp("\\\\","g"),"");document.cookie=name+"="+encodeURIComponent(value)+"; expires="+60*24+"; path=/"};$.sq_getCookie=function(name){var nameEQ=name+"=";var ca=document.cookie.split(";");for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==" ")c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return decodeURIComponent(c.substring(nameEQ.length,c.length))}return null};$.sq_getHashParam=function(key){var urlparts=location.href.split("#");if(urlparts.length>=2){urlparts.shift();var queryString=urlparts.join("#");var results=new RegExp("[\\?&#]*"+key+"=([^&#]*)").exec(queryString);if(results){return results[1]||0}}return false};$.sq_setHashParam=function(key,val){var urlparts=location.href.split("#");if(urlparts.length>=2){var add=true;var urlBase=urlparts.shift();var queryString=urlparts.join("#");var prefix=encodeURIComponent(key)+"=";var pars=queryString.split(/[&;]/g);for(var i=pars.length;i-- >0;){if(pars[i].lastIndexOf(prefix,0)!==-1||pars[i]===""){pars[i]=pars[i].replace(pars[i],prefix+val);add=false;break}}add&&pars.push(prefix+val);location.href=urlBase+"#"+pars.join("&")}else{location.href+="#"+key+"="+val}};$.sq_getParam=function getUrlParameter(sParam){var sPageURL=window.location.search.substring(1),sURLVariables=sPageURL.split("&"),sParameterName,i;for(i=0;i<sURLVariables.length;i++){sParameterName=sURLVariables[i].split("=");if(sParameterName[0]===sParam){return sParameterName[1]===undefined?true:decodeURIComponent(sParameterName[1])}}return false};$.sq_loadChart=function(div){new Chart(div,{type:"bar",data:{labels:["","","","","","",""],datasets:[{data:div.data("values").split(","),borderWidth:0}]},options:{tooltips:{enabled:false},legend:{display:false},layout:{padding:{left:0,right:0,top:0,bottom:0}},title:{display:false},scales:{yAxes:[{display:false,ticks:{beginAtZero:true,min:0,max:1}}],xAxes:[{display:false,ticks:{beginAtZero:true}}]}}})};$.sq_showMessage=function(text,time){$(".sq_alert").remove();if(text.indexOf("<div>")==-1){text=$('<div class="sq_alert position-fixed fixed-top text-center text-white bg-success m-0 p-3 border border-white sq-position-fixed sq-fixed-top sq-text-center sq-text-white sq-bg-success sq-m-0 sq-p-4 sq-border sq-border-white">'+text+"</div>")}$("body").prepend(text);if(typeof time==="undefined"){time=2e3}setTimeout(function(){text.remove()},time);return text};$.fn.sq_addBriefcase=function(){var $this=this;$this.addClass("sq_minloading");$.post(sqQuery.ajaxurl,{action:"sq_briefcase_addkeyword",keyword:$this.data("keyword"),doserp:parseInt($this.data("doserp")),hidden:parseInt($this.data("hidden")),sq_nonce:sqQuery.nonce}).done(function(response){$this.removeClass("sq_minloading");if(typeof response.message!=="undefined"){$.sq_showMessage(response.message).addClass("sq_success");$this.closest("tr").addClass("bg-briefcase")}else if(typeof response.error!=="undefined"){$.sq_showMessage(response.error);$this.removeClass("sq_minloading")}else{$this.removeClass("sq_minloading");location.reload()}}).fail(function(){$this.removeClass("sq_minloading")})};$.fn.sq_ajaxCallListen=function(){var $this=this;var $input=$("#"+$this.data("input"));var $confirm=$this.data("confirm");var $action=$this.data("action");var $redirect=$this.data("redirect");var $javascript=$this.data("javascript");var $name=$this.data("name");var $value=0;if(!$input.length){$input=$this}if(typeof $confirm!=="undefined"){if(!confirm($confirm))return}if($input.is("input")&&$input.attr("type")==="checkbox"){if($input.is(":checked")){$value=$input.val()}}else{if($input.is("select")){$value=$input.find("option:selected").val()}else{if($input.is("input")&&$input.val()!==""){$value=$input.val()}}}$this.addClass("sq_minloading");if($action!==""&&$value!==""){return $.post(sqQuery.ajaxurl,{action:$action,input:$name,value:$value,referal:location.href,sq_nonce:sqQuery.nonce}).done(function(response){if(typeof response.data!=="undefined"){if(response.data===""){$("#wpbody-content").prepend("Saved")}else{$("#wpbody-content").prepend(response.data)}if(response.assistant!==""&&response.assistant_dest){var show_url=$(".sq_assistant").find("ul:visible").attr("id");$(response.assistant_dest).html(response.assistant);if(show_url)$("#"+show_url).show()}setTimeout(function(){$this.removeClass("sq_minloading");if(typeof $javascript!=="undefined"){eval($javascript)}else if(typeof $redirect!=="undefined"){window.open($redirect,"_blank")}else{location.reload()}},1e3)}else if(typeof response.error!=="undefined"){$.sq_showMessage(response.error);$this.removeClass("sq_minloading")}else{$this.removeClass("sq_minloading");location.reload()}}).fail(function(){$this.removeClass("sq_minloading")},"json")}};$.fn.sq_getAccount=function(){var $this=this;$this.addClass("sq_minloading");$.post(sqQuery.ajaxurl,{action:"sq_ajax_account_getaccount",sq_nonce:sqQuery.nonce}).done(function(response){if(typeof response!=="undefined"){if(typeof response.html!=="undefined"){$this.html(response.html)}}$this.removeClass("sq_minloading")}).fail(function(){$this.removeClass("sq_minloading")},"json")};$(document).ready(function(){SQ_DEBUG&&console.log("sq_GlobalInit");if($(".sq_account_info").length>0){$(".sq_account_info").sq_getAccount()}$(".sq_trend:visible").each(function(){$.sq_loadChart($(this))});$(".sq_kr_research").on("show.bs.modal",function(){$.sq_loadChart($(this).find(".sq_trend"))});if($(".sq_save_ajax").length>0){$(".sq_save_ajax").find("input").on("change",function(){$(this).sq_ajaxCallListen()});$(".sq_save_ajax").find("input[type=image]").on("click",function(){$(this).sq_ajaxCallListen()});$(".sq_save_ajax").find("button").on("click",function(){$(this).sq_ajaxCallListen()})}$("button.show_advanced").on("click",function(){$(".sq_advanced").show();$("button.show_advanced").hide();$("button.hide_advanced").show()});$("button.hide_advanced").on("click",function(){$(".sq_advanced").hide();$("button.hide_advanced").hide();$("button.show_advanced").show()});$("button[type=submit]").not(".noloading").on("click",function(){$(this).addClass("sq_minloading")});$("form#sq_register").on("submit",function(){$(this).find("button[type=submit]").addClass("sq_minloading")})})})(jQuery);
1
+ if(typeof SQ_DEBUG==="undefined")var SQ_DEBUG=false;(function($){"use strict";$.sq_setCookie=function(name,value){value=value.toString().replace(new RegExp("\\\\","g"),"");document.cookie=name+"="+encodeURIComponent(value)+"; expires="+60*24+"; path=/"};$.sq_getCookie=function(name){var nameEQ=name+"=";var ca=document.cookie.split(";");for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==" ")c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return decodeURIComponent(c.substring(nameEQ.length,c.length))}return null};$.sq_getHashParam=function(key){var urlparts=location.href.split("#");if(urlparts.length>=2){urlparts.shift();var queryString=urlparts.join("#");var results=new RegExp("[\\?&#]*"+key+"=([^&#]*)").exec(queryString);if(results){return results[1]||0}}return false};$.sq_setHashParam=function(key,val){var urlparts=location.href.split("#");if(urlparts.length>=2){var add=true;var urlBase=urlparts.shift();var queryString=urlparts.join("#");var prefix=encodeURIComponent(key)+"=";var pars=queryString.split(/[&;]/g);for(var i=pars.length;i-- >0;){if(pars[i].lastIndexOf(prefix,0)!==-1||pars[i]===""){pars[i]=pars[i].replace(pars[i],prefix+val);add=false;break}}add&&pars.push(prefix+val);location.href=urlBase+"#"+pars.join("&")}else{location.href+="#"+key+"="+val}};$.sq_getParam=function getUrlParameter(sParam){var sPageURL=window.location.search.substring(1),sURLVariables=sPageURL.split("&"),sParameterName,i;for(i=0;i<sURLVariables.length;i++){sParameterName=sURLVariables[i].split("=");if(sParameterName[0]===sParam){return sParameterName[1]===undefined?true:decodeURIComponent(sParameterName[1])}}return false};$.sq_loadChart=function(div){new Chart(div,{type:"bar",data:{labels:["","","","","","",""],datasets:[{data:div.data("values").split(","),borderWidth:0}]},options:{tooltips:{enabled:false},legend:{display:false},layout:{padding:{left:0,right:0,top:0,bottom:0}},title:{display:false},scales:{yAxes:[{display:false,ticks:{beginAtZero:true,min:0,max:1}}],xAxes:[{display:false,ticks:{beginAtZero:true}}]}}})};$.sq_showMessage=function(text,time){$(".sq_alert").remove();if(text.indexOf("<div>")==-1){text=$('<div class="sq_alert position-fixed fixed-top text-center text-white bg-success m-0 p-3 border border-white sq-position-fixed sq-fixed-top sq-text-center sq-text-white sq-bg-success sq-m-0 sq-p-4 sq-border sq-border-white">'+text+"</div>")}$("body").prepend(text);if(typeof time==="undefined"){time=2e3}setTimeout(function(){text.remove()},time);return text};$.fn.sq_addBriefcase=function(){var $this=this;$this.addClass("sq_minloading");$.post(sqQuery.ajaxurl,{action:"sq_briefcase_addkeyword",keyword:$this.data("keyword"),doserp:parseInt($this.data("doserp")),hidden:parseInt($this.data("hidden")),sq_nonce:sqQuery.nonce}).done(function(response){$this.removeClass("sq_minloading");if(typeof response.message!=="undefined"){$.sq_showMessage(response.message).addClass("sq_success");$this.closest("tr").addClass("bg-briefcase")}else if(typeof response.error!=="undefined"){$.sq_showMessage(response.error);$this.removeClass("sq_minloading")}else{$this.removeClass("sq_minloading");location.reload()}}).fail(function(){$this.removeClass("sq_minloading")})};$.fn.sq_ajaxCallListen=function(){var $this=this;var $input=$("#"+$this.data("input"));var $confirm=$this.data("confirm");var $action=$this.data("action");var $redirect=$this.data("redirect");var $javascript=$this.data("javascript");var $name=$this.data("name");var $value=0;if(!$input.length){$input=$this}if(typeof $confirm!=="undefined"){if(!confirm($confirm))return}if($input.is("input")&&$input.attr("type")==="checkbox"){if($input.is(":checked")){$value=$input.val()}}else{if($input.is("select")){$value=$input.find("option:selected").val()}else{if($input.is("input")&&$input.val()!==""){$value=$input.val()}}}$this.addClass("sq_minloading");if($action!==""&&$value!==""){return $.post(sqQuery.ajaxurl,{action:$action,input:$name,value:$value,referal:location.href,sq_nonce:sqQuery.nonce}).done(function(response){if(typeof response.data!=="undefined"){if(response.data===""){$("#wpbody-content").prepend("Saved")}else{$("#wpbody-content").prepend(response.data)}if(response.assistant!==""&&response.assistant_dest){var show_url=$(".sq_assistant").find("ul:visible").attr("id");$(response.assistant_dest).html(response.assistant);if(show_url)$("#"+show_url).show()}setTimeout(function(){$this.removeClass("sq_minloading");if(typeof $javascript!=="undefined"){eval($javascript)}else if(typeof $redirect!=="undefined"){window.open($redirect,"_blank")}else{location.reload()}},1e3)}else if(typeof response.error!=="undefined"){$.sq_showMessage(response.error);$this.removeClass("sq_minloading")}else{$this.removeClass("sq_minloading");location.reload()}}).fail(function(){$this.removeClass("sq_minloading")},"json")}};$.fn.sq_getAccount=function(){var $this=this;$this.addClass("sq_minloading");$.post(sqQuery.ajaxurl,{action:"sq_ajax_account_getaccount",sq_nonce:sqQuery.nonce}).done(function(response){if(typeof response!=="undefined"){if(typeof response.html!=="undefined"){$this.html(response.html)}}$this.removeClass("sq_minloading")}).fail(function(){$this.removeClass("sq_minloading")},"json")};$(document).ready(function(){SQ_DEBUG&&console.log("sq_GlobalInit");if($(".sq_account_info").length>0){$(".sq_account_info").sq_getAccount()}$(".sq_trend:visible").each(function(){$.sq_loadChart($(this))});if($(".sq_save_ajax").length>0){$(".sq_save_ajax").find("input").on("change",function(){$(this).sq_ajaxCallListen()});$(".sq_save_ajax").find("input[type=image]").on("click",function(){$(this).sq_ajaxCallListen()});$(".sq_save_ajax").find("button").on("click",function(){$(this).sq_ajaxCallListen()})}$("button.show_advanced").on("click",function(){$(".sq_advanced").show();$("button.show_advanced").hide();$("button.hide_advanced").show()});$("button.hide_advanced").on("click",function(){$(".sq_advanced").hide();$("button.hide_advanced").hide();$("button.show_advanced").show()});$("button[type=submit]").not(".noloading").on("click",function(){$(this).addClass("sq_minloading")});$("form#sq_register").on("submit",function(){$(this).find("button[type=submit]").addClass("sq_minloading")})})})(jQuery);
view/assets/js/research.min.js CHANGED
@@ -1 +1 @@
1
- if(typeof SQ_DEBUG==="undefined")var SQ_DEBUG=false;(function($){"use strict";var sqs_script="kr";$(document).keypress(function(event){var keycode=event.keyCode||event.which;if(keycode==13){$(".sqd-submit:visible").trigger("click")}});$.sq_steps=function(step){if(step===2&&$("input[name=sq_input_keyword]").val()===""){$.sq_showMessage("Add a keyword first",2e3);return}$(".sq_step").hide();$(".sq_step"+step).show()};$.fn.sq_getSuggested=function(){var $this=this;var $keywords=$("input[name=sq_input_keyword]").val();var $country=$("select[name=sq_select_country] option:selected").val();$.sq_setCookie("sq_country",$country);if($keywords!==""){$.sq_steps(3);$this.addClass("sq_loading");$.post(sqQuery.ajaxurl,{action:"sq_ajax_research_others",keyword:$keywords,country:$country,lang:"en",sq_nonce:sqQuery.nonce}).done(function(response){$this.removeClass("sq_loading");var $count=0;if(typeof response.keywords!=="undefined"&&response.keywords!==null&&response.keywords.length>0){$this.find(".sq_suggested").each(function(){if(typeof response.keywords[$count]!=="undefined"){$(this).html('<input type="checkbox" id="sq_input_keywords'+$count+'" name="sq_input_keywords[]" class="sq_input_keywords custom-control-input" value="'+response.keywords[$count]+'"><label class="custom-control-label" for="sq_input_keywords'+$count+'">'+response.keywords[$count]+"</label>");$count++}else{$(this).hide()}});var limit=3;$this.find("input.sq_input_keywords").on("change",function(evt){if($this.find("input.sq_input_keywords:checked").length>limit){$(this).prop("checked",false);alert($this.find("div.text-danger").text())}})}else if(typeof response.error!=="undefined"&&response.error==="limit_exceeded"){$this.find(".sq_limit_exceeded").show()}else{$this.find(".sq_research_error").show()}}).fail(function(){$this.removeClass("sq_loading").show();$this.prepend('<div class="text-center text-warning">Squirrly Library loading error. Please contact us at support@squirrly.co</div>')})}else{$(".sq_step2").find(".sq_research_error").show()}};$.fn.sq_getResearch=function($count){var $this=this;$.sq_steps(4);$this.find(".btn").hide();var $loadingdiv=$("div.sq_step4").find(".sq_loading_steps");var $keywords=$("input[name=sq_input_keyword]").val();var $post_id=$("input[name=post_id]").val();var $process=0;var $table=$("div.sq_step4 table");var $country=$("select[name=sq_select_country] option:selected").val();$.sq_setCookie("sq_country",$country);if(typeof $count==="undefined"){$count=10}$("input.sq_input_keywords:checked").each(function(){$keywords+=","+$(this).val()});if($.fn.DataTable.isDataTable($table)){$table.DataTable().destroy();$table.find("tbody").html("");$table.hide();$this.off("sq_research_loaded");$(".sq_research_success").hide();$loadingdiv.hide()}$this.addClass("sq_loading");var $loadingstep=1;$loadingdiv.show();$loadingdiv.find(".sq_loading_step").hide();$loadingdiv.find(".sq_loading_step"+$loadingstep).show();$.post(sqQuery.ajaxurl,{action:"sq_ajax_research_process",keywords:$keywords,country:$country,count:$count,lang:"en",sq_nonce:sqQuery.nonce}).done(function(response){if(typeof response.error!=="undefined"){$this.removeClass("sq_loading");$loadingdiv.hide();$.sq_showMessage(response.error,1e4).addClass("sq_error")}else{if(typeof response.id!=="undefined"){$process=response.id}$this.trigger("sq_research_loaded")}},"json");$this.on("sq_research_loaded",function(){if($process){$.post(sqQuery.ajaxurl,{action:"sq_ajax_research_process",id:$process,post_id:$post_id,sq_nonce:sqQuery.nonce}).done(function(response){if(typeof response.error!=="undefined"){$this.off("sq_research_loaded");$this.removeClass("sq_loading");$loadingdiv.hide();$this.find(".btn").show();$.sq_showMessage(response.error,1e4).addClass("sq_error")}if(typeof response.done!=="undefined"&&response.done&&typeof response.html!=="undefined"){$this.off("sq_research_loaded");$this.removeClass("sq_loading");$loadingdiv.hide();$this.find(".btn").show();$table.find("tbody").html(response.html);$table.show();$(".sq_research_success").show();$table.find(".sq_trend:visible").each(function(){$.sq_loadChart($(this))});$table.find(".sq_research_add_briefcase").each(function(){$(this).on("click",function(){$(this).sq_addBriefcase()})});$.extend($.fn.dataTableExt.oSort,{"formatted-value-pre":function(a){return $("<div></div>").append(a).find("span").data("value")},"formatted-value-asc":function(a,b){return a-b},"formatted-value-desc":function(a,b){return b-a}});$table.DataTable({columnDefs:[{targets:[5,6],sortable:false},{targets:[2,3,4],sortable:true,type:"formatted-value"}],bPaginate:false,bLengthChange:false,bFilter:true,iDisplayLength:50,fixedColumns:true})}else{$loadingstep++;if($loadingstep<=9){$loadingdiv.find(".sq_loading_step").hide();$loadingdiv.find(".sq_loading_step"+$loadingstep).show()}if($loadingstep>50){$this.off("sq_research_loaded");$this.removeClass("sq_loading");$loadingdiv.hide();$this.find(".btn").show();$.sq_showMessage("Lost connection with the server. Please make sure you whitelisted the IP from https://api.squirrly.co",1e4).addClass("sq_error")}setTimeout(function(){$this.trigger("sq_research_loaded")},5e3)}}).fail(function(){$this.removeClass("sq_loading");$loadingdiv.hide();$this.find(".btn").show();$(".sq_research_timeout_error").show()},"json")}else{$this.off("sq_research_loaded");$this.removeClass("sq_loading");$loadingdiv.hide();$this.find(".btn").show();$.sq_showMessage("Could not start the research on our server. Please check again in a minute.",1e4).addClass("sq_error")}});return $this};$.fn.sq_getHistory=function(){var $this=this;var $id=$this.data("id");var $destination=$($this.data("destination"));if(!$destination.length){if(!$("#history"+$id).length){$destination=$('<tr id="history'+$id+'"></tr>');$this.parents("tr:last").after($destination);$destination.show()}}else{$($destination).remove();return}if($($destination).is(":visible")){$this.addClass("sq_minloading");$.post(sqQuery.ajaxurl,{action:"sq_ajax_research_history",id:$this.data("id"),sq_nonce:sqQuery.nonce}).done(function(response){$this.removeClass("sq_minloading");if(typeof response.html!=="undefined"){$destination.html(response.html);$destination.find(".sq_trend:visible").each(function(){$.sq_loadChart($(this))})}$destination.find(".sq_research_add_briefcase").each(function(){$(this).on("click",function(){$(this).sq_addBriefcase()})})}).fail(function(){$this.removeClass("sq_minloading");$destination.html('<td colspan="4" class="col-sm-12 text-center my-3 text-danger">Could not find the records</td>')},"json")}};$(document).ready(function(){$(".sq_history_details").on("click",function(){$(this).sq_getHistory()});$(".sq_research_add_briefcase").each(function(){$(this).on("click",function(){$(this).sq_addBriefcase()})});$(".dropdown-toggle").dropdown()})})(jQuery);
1
+ if(typeof SQ_DEBUG==="undefined")var SQ_DEBUG=false;(function($){"use strict";var sqs_script="kr";$(document).keypress(function(event){var keycode=event.keyCode||event.which;if(keycode==13){$(".sqd-submit:visible").trigger("click")}});$.sq_steps=function(step){if(step===2&&$("input[name=sq_input_keyword]").val()===""){$.sq_showMessage("Add a keyword first",2e3);return}$(".sq_step").hide();$(".sq_step"+step).show()};$.fn.sq_getSuggested=function(){var $this=this;var $keywords=$("input[name=sq_input_keyword]").val();var $country=$("select[name=sq_select_country] option:selected").val();$.sq_setCookie("sq_country",$country);if($keywords!==""){$.sq_steps(3);$this.addClass("sq_loading");$.post(sqQuery.ajaxurl,{action:"sq_ajax_research_others",keyword:$keywords,country:$country,lang:"en",sq_nonce:sqQuery.nonce}).done(function(response){$this.removeClass("sq_loading");var $count=0;if(typeof response.keywords!=="undefined"&&response.keywords!==null&&response.keywords.length>0){$this.find(".sq_suggested").each(function(){if(typeof response.keywords[$count]!=="undefined"){$(this).html('<input type="checkbox" id="sq_input_keywords'+$count+'" name="sq_input_keywords[]" class="sq_input_keywords custom-control-input" value="'+response.keywords[$count]+'"><label class="custom-control-label" for="sq_input_keywords'+$count+'">'+response.keywords[$count]+"</label>");$count++}else{$(this).hide()}});var limit=3;$this.find("input.sq_input_keywords").on("change",function(evt){if($this.find("input.sq_input_keywords:checked").length>limit){$(this).prop("checked",false);alert($this.find("div.text-danger").text())}})}else if(typeof response.error!=="undefined"&&response.error==="limit_exceeded"){$this.find(".sq_limit_exceeded").show()}else{$this.find(".sq_research_error").show()}}).fail(function(){$this.removeClass("sq_loading").show();$this.prepend('<div class="text-center text-warning">Squirrly Library loading error. Please contact us at support@squirrly.co</div>')})}else{$(".sq_step2").find(".sq_research_error").show()}};$.fn.sq_getResearch=function($count){var $this=this;$.sq_steps(4);$this.find(".btn").hide();var $loadingdiv=$("div.sq_step4").find(".sq_loading_steps");var $keywords=$("input[name=sq_input_keyword]").val();var $post_id=$("input[name=post_id]").val();var $process=0;var $table=$("div.sq_step4 table");var $country=$("select[name=sq_select_country] option:selected").val();$.sq_setCookie("sq_country",$country);if(typeof $count==="undefined"){$count=10}$("input.sq_input_keywords:checked").each(function(){$keywords+=","+$(this).val()});if($.fn.DataTable.isDataTable($table)){$table.DataTable().destroy();$table.find("tbody").html("");$table.hide();$this.off("sq_research_loaded");$(".sq_research_success").hide();$loadingdiv.hide()}$this.addClass("sq_loading");var $loadingstep=1;$loadingdiv.show();$loadingdiv.find(".sq_loading_step").hide();$loadingdiv.find(".sq_loading_step"+$loadingstep).show();$.post(sqQuery.ajaxurl,{action:"sq_ajax_research_process",keywords:$keywords,country:$country,count:$count,lang:"en",sq_nonce:sqQuery.nonce}).done(function(response){if(typeof response.error!=="undefined"){$this.removeClass("sq_loading");$loadingdiv.hide();$.sq_showMessage(response.error,1e4).addClass("sq_error")}else{if(typeof response.id!=="undefined"){$process=response.id}$this.trigger("sq_research_loaded")}},"json");$this.on("sq_research_loaded",function(){if($process){$.post(sqQuery.ajaxurl,{action:"sq_ajax_research_process",id:$process,post_id:$post_id,sq_nonce:sqQuery.nonce}).done(function(response){if(typeof response.error!=="undefined"){$this.off("sq_research_loaded");$this.removeClass("sq_loading");$loadingdiv.hide();$this.find(".btn").show();$.sq_showMessage(response.error,1e4).addClass("sq_error")}if(typeof response.done!=="undefined"&&response.done&&typeof response.html!=="undefined"){$this.off("sq_research_loaded");$this.removeClass("sq_loading");$loadingdiv.hide();$this.find(".btn").show();$table.find("tbody").html(response.html);$table.show();$(".sq_research_success").show();$table.find(".sq_research_add_briefcase").each(function(){$(this).on("click",function(){$(this).sq_addBriefcase()})});$.extend($.fn.dataTableExt.oSort,{"formatted-value-pre":function(a){return $("<div></div>").append(a).find("span").data("value")},"formatted-value-asc":function(a,b){return a-b},"formatted-value-desc":function(a,b){return b-a}});$table.DataTable({columnDefs:[{targets:[5,6],sortable:false},{targets:[2,3,4],sortable:true,type:"formatted-value"}],bPaginate:false,bLengthChange:false,bFilter:true,iDisplayLength:50,fixedColumns:true})}else{$loadingstep++;if($loadingstep<=9){$loadingdiv.find(".sq_loading_step").hide();$loadingdiv.find(".sq_loading_step"+$loadingstep).show()}if($loadingstep>50){$this.off("sq_research_loaded");$this.removeClass("sq_loading");$loadingdiv.hide();$this.find(".btn").show();$.sq_showMessage("Lost connection with the server. Please make sure you whitelisted the IP from https://api.squirrly.co",1e4).addClass("sq_error")}setTimeout(function(){$this.trigger("sq_research_loaded")},5e3)}}).fail(function(){$this.removeClass("sq_loading");$loadingdiv.hide();$this.find(".btn").show();$(".sq_research_timeout_error").show()},"json")}else{$this.off("sq_research_loaded");$this.removeClass("sq_loading");$loadingdiv.hide();$this.find(".btn").show();$.sq_showMessage("Could not start the research on our server. Please check again in a minute.",1e4).addClass("sq_error")}});return $this};$.fn.sq_getHistory=function(){var $this=this;var $id=$this.data("id");var $destination=$($this.data("destination"));if(!$destination.length){if(!$("#history"+$id).length){$destination=$('<tr id="history'+$id+'"></tr>');$this.parents("tr:last").after($destination);$destination.show()}}else{$($destination).remove();return}if($($destination).is(":visible")){$this.addClass("sq_minloading");$.post(sqQuery.ajaxurl,{action:"sq_ajax_research_history",id:$this.data("id"),sq_nonce:sqQuery.nonce}).done(function(response){$this.removeClass("sq_minloading");if(typeof response.html!=="undefined"){$destination.html(response.html)}$destination.find(".sq_research_add_briefcase").each(function(){$(this).on("click",function(){$(this).sq_addBriefcase()})})}).fail(function(){$this.removeClass("sq_minloading");$destination.html('<td colspan="4" class="col-sm-12 text-center my-3 text-danger">Could not find the records</td>')},"json")}};$(document).ready(function(){$(".sq_history_details").on("click",function(){$(this).sq_getHistory()});$(".sq_research_add_briefcase").each(function(){$(this).on("click",function(){$(this).sq_addBriefcase()})});$(".dropdown-toggle").dropdown()})})(jQuery);