Social Share Buttons by Supsystic - Version 2.2.4

Version Description

/ 09.06.2022 = Security fixes

Download this release

Release Info

Developer supsystic.com
Plugin Icon 128x128 Social Share Buttons by Supsystic
Version 2.2.4
Comparing to
See all releases

Code changes from version 2.2.3 to 2.2.4

app/SupsysticSocialSharing.php CHANGED
@@ -18,7 +18,7 @@ class SupsysticSocialSharing
18
  $pluginName = 'sss';
19
  $pluginTitleName = 'Social Share by Supsystic';
20
  $pluginSlug = 'supsystic-social-sharing';
21
- $environment = new Rsc_Environment($pluginName, '2.2.3', $pluginPath);
22
 
23
  /* Configure */
24
  $environment->configure(
18
  $pluginName = 'sss';
19
  $pluginTitleName = 'Social Share by Supsystic';
20
  $pluginSlug = 'supsystic-social-sharing';
21
+ $environment = new Rsc_Environment($pluginName, '2.2.4', $pluginPath);
22
 
23
  /* Configure */
24
  $environment->configure(
index.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Social Share Buttons by Supsystic
5
  * Plugin URI: http://supsystic.com
6
  * Description: Social share buttons to increase social traffic and popularity. Social sharing to Facebook, Twitter and other social networks
7
- * Version: 2.2.3
8
  * Author: supsystic.com
9
  * Author URI: http://supsystic.com
10
  **/
@@ -13,7 +13,4 @@ include dirname(__FILE__) . '/app/SupsysticSocialSharing.php';
13
 
14
  $supsysticSocialSharing = new SupsysticSocialSharing();
15
 
16
- $supsysticSocialSharing->activate(__FILE__);
17
- $supsysticSocialSharing->deactivate(__FILE__);
18
-
19
  $supsysticSocialSharing->run();
4
  * Plugin Name: Social Share Buttons by Supsystic
5
  * Plugin URI: http://supsystic.com
6
  * Description: Social share buttons to increase social traffic and popularity. Social sharing to Facebook, Twitter and other social networks
7
+ * Version: 2.2.4
8
  * Author: supsystic.com
9
  * Author URI: http://supsystic.com
10
  **/
13
 
14
  $supsysticSocialSharing = new SupsysticSocialSharing();
15
 
 
 
 
16
  $supsysticSocialSharing->run();
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === Social Share Buttons by Supsystic ===
2
  Contributors: supsystic.com
3
  Tags: share counter, social media share, social network share, social share, social share buttons, social sharing, facebook like, facebook share, facebook share button, like, share buttons, share links, sharebar, social buttons, facebook, facebook integration, facebook connect, google+, twitter, twitter share, linkedin share, pinterest button, button, share
4
- Tested up to: 5.8
5
- Stable tag: 2.2.3
6
 
7
  Social share buttons to increase social traffic and popularity. Social sharing to Facebook like and share, Twitter, Pinterest and other social networks
8
 
@@ -198,6 +198,8 @@ Here you can set when to show social share buttons:
198
 
199
 
200
  == Changelog ==
 
 
201
  = 2.2.3 / 06.12.2021 =
202
  * Add support WP 5.8.2
203
 
1
  === Social Share Buttons by Supsystic ===
2
  Contributors: supsystic.com
3
  Tags: share counter, social media share, social network share, social share, social share buttons, social sharing, facebook like, facebook share, facebook share button, like, share buttons, share links, sharebar, social buttons, facebook, facebook integration, facebook connect, google+, twitter, twitter share, linkedin share, pinterest button, button, share
4
+ Tested up to: 6.0
5
+ Stable tag: 2.2.4
6
 
7
  Social share buttons to increase social traffic and popularity. Social sharing to Facebook like and share, Twitter, Pinterest and other social networks
8
 
198
 
199
 
200
  == Changelog ==
201
+ = 2.2.4 / 09.06.2022 =
202
+ Security fixes
203
  = 2.2.3 / 06.12.2021 =
204
  * Add support WP 5.8.2
205
 
src/SocialSharing/Core/BaseController.php CHANGED
@@ -118,4 +118,42 @@ class SocialSharing_Core_BaseController extends Rsc_Mvc_Controller
118
  array_merge(array('success' => false, 'message' => $message), $data)
119
  );
120
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  }
118
  array_merge(array('success' => false, 'message' => $message), $data)
119
  );
120
  }
121
+
122
+ public function _checkNonce($request){
123
+ $nonce = '';
124
+ if (!empty($requestRoute = $request->post->get('route'))) {
125
+ if (!empty($requestRoute['nonce'])) {
126
+ $nonce = $requestRoute['nonce'];
127
+ }
128
+ }
129
+ if (!empty($request->post->get('nonce'))) {
130
+ $nonce = $request->post->get('nonce');
131
+ }
132
+ if (!empty($request->query->get('nonce'))) {
133
+ $nonce = $request->query->get('nonce');
134
+ }
135
+ if ( !empty($nonce) && wp_verify_nonce( $nonce, 'ssbs_nonce') ) {
136
+ return true;
137
+ }
138
+ return false;
139
+ }
140
+
141
+ public function _checkNonceFrontend($request){
142
+ $nonce = '';
143
+ if (!empty($requestRoute = $request->post->get('route'))) {
144
+ if (!empty($requestRoute['nonce'])) {
145
+ $nonce = $requestRoute['nonce'];
146
+ }
147
+ }
148
+ if (!empty($request->post->get('nonce'))) {
149
+ $nonce = $request->post->get('nonce');
150
+ }
151
+ if (!empty($request->query->get('nonce'))) {
152
+ $nonce = $request->query->get('nonce');
153
+ }
154
+ if ( !empty($nonce) && wp_verify_nonce( $nonce, 'ssbs_nonce_frontend') ) {
155
+ return true;
156
+ }
157
+ return false;
158
+ }
159
  }
src/SocialSharing/Core/BaseModule.php CHANGED
@@ -27,4 +27,4 @@ class SocialSharing_Core_BaseModule extends Rsc_Mvc_Module
27
 
28
  return $controller->getModelsFactory();
29
  }
30
- }
27
 
28
  return $controller->getModelsFactory();
29
  }
30
+ }
src/SocialSharing/Core/assets/js/core.js CHANGED
@@ -23,6 +23,7 @@
23
  }
24
 
25
  data.action = 'social-sharing';
 
26
 
27
  var request = $.post(window.ajaxurl, $.extend({}, { route: route }, data)),
28
  deferred = $.Deferred();
@@ -56,4 +57,4 @@
56
  });
57
  }
58
 
59
- }(window.supsystic = window.supsystic || {}, window.jQuery, window));
23
  }
24
 
25
  data.action = 'social-sharing';
26
+ data.nonce = SSBS_NONCE;
27
 
28
  var request = $.post(window.ajaxurl, $.extend({}, { route: route }, data)),
29
  deferred = $.Deferred();
57
  });
58
  }
59
 
60
+ }(window.supsystic = window.supsystic || {}, window.jQuery, window));
src/SocialSharing/Featuredplugins/Controller.php CHANGED
@@ -18,7 +18,7 @@ class SocialSharing_Featuredplugins_Controller extends SocialSharing_Core_BaseCo
18
  //framePps::_()->getModule('templates')->loadGoogleFont('Montserrat');
19
  $environment = $this->getEnvironment();
20
 
21
-
22
  $siteUrl = 'https://supsystic.com/';
23
  $pluginsUrl = $siteUrl. 'plugins/';
24
  $uploadsUrl = $siteUrl. 'wp-content/uploads/';
@@ -55,4 +55,4 @@ class SocialSharing_Featuredplugins_Controller extends SocialSharing_Core_BaseCo
55
  )
56
  );
57
  }
58
- }
18
  //framePps::_()->getModule('templates')->loadGoogleFont('Montserrat');
19
  $environment = $this->getEnvironment();
20
 
21
+
22
  $siteUrl = 'https://supsystic.com/';
23
  $pluginsUrl = $siteUrl. 'plugins/';
24
  $uploadsUrl = $siteUrl. 'wp-content/uploads/';
55
  )
56
  );
57
  }
58
+ }
src/SocialSharing/Networks/Controller.php CHANGED
@@ -11,6 +11,7 @@ class SocialSharing_Networks_Controller extends SocialSharing_Core_BaseControlle
11
  */
12
  public function allAction()
13
  {
 
14
  $networks = $this->modelsFactory->get('networks')->all();
15
 
16
  return $this->response(
@@ -25,6 +26,7 @@ class SocialSharing_Networks_Controller extends SocialSharing_Core_BaseControlle
25
  */
26
  public function addToProjectAction(Rsc_Http_Request $request)
27
  {
 
28
  $networks = $request->post->get('networks');
29
  $projectId = $request->post->get('project_id');
30
 
@@ -46,6 +48,7 @@ class SocialSharing_Networks_Controller extends SocialSharing_Core_BaseControlle
46
  */
47
  public function incrementAction(Rsc_Http_Request $request)
48
  {
 
49
  $id = $request->post->get('id');
50
  $this->modelsFactory->get('networks')->incrementTotalShares($id);
51
 
@@ -53,6 +56,7 @@ class SocialSharing_Networks_Controller extends SocialSharing_Core_BaseControlle
53
  }
54
 
55
  public function saveTooltipsAction(Rsc_Http_Request $request) {
 
56
  $projectId = (int)$request->post->get('project_id');
57
  $data = $request->post->get('data', array());
58
  $networkId = array_key_exists('id', $data) ? (int)$data['id'] : null;
@@ -69,6 +73,7 @@ class SocialSharing_Networks_Controller extends SocialSharing_Core_BaseControlle
69
  }
70
 
71
  public function saveTitlesAction(Rsc_Http_Request $request) {
 
72
  $projectId = (int)$request->post->get('project_id');
73
  $data = $request->post->get('data', array());
74
  $networkId = array_key_exists('id', $data) ? (int)$data['id'] : null;
@@ -85,6 +90,7 @@ class SocialSharing_Networks_Controller extends SocialSharing_Core_BaseControlle
85
  }
86
 
87
  public function saveProfileNameAction(Rsc_Http_Request $request) {
 
88
  $projectId = (int)$request->post->get('project_id');
89
  $data = $request->post->get('data', array());
90
  $networkId = array_key_exists('id', $data) ? (int)$data['id'] : null;
@@ -101,6 +107,7 @@ class SocialSharing_Networks_Controller extends SocialSharing_Core_BaseControlle
101
  }
102
 
103
  public function saveIconImageAction(Rsc_Http_Request $request) {
 
104
  $projectId = (int)$request->post->get('project_id');
105
  $data = $request->post->get('data', array());
106
  $networkId = array_key_exists('id', $data) ? (int) $data['id'] : null;
@@ -118,6 +125,7 @@ class SocialSharing_Networks_Controller extends SocialSharing_Core_BaseControlle
118
  }
119
 
120
  public function saveTextFormatAction(Rsc_Http_Request $request) {
 
121
  $projectId = (int)$request->post->get('project_id');
122
  $data = $request->post->get('data', array());
123
  $networkId = array_key_exists('id', $data) ? (int)$data['id'] : null;
@@ -134,6 +142,7 @@ class SocialSharing_Networks_Controller extends SocialSharing_Core_BaseControlle
134
  }
135
 
136
  public function saveUseShortUrlAction(Rsc_Http_Request $request) {
 
137
  $projectId = (int)$request->post->get('project_id');
138
  $data = $request->post->get('data', array());
139
  $networkId = array_key_exists('id', $data) ? (int)$data['id'] : null;
@@ -150,6 +159,7 @@ class SocialSharing_Networks_Controller extends SocialSharing_Core_BaseControlle
150
  }
151
 
152
  public function saveNamesAction(Rsc_Http_Request $request) {
 
153
  $projectId = (int)$request->post->get('project_id');
154
  $data = $request->post->get('data', array());
155
  $networkId = array_key_exists('id', $data) ? (int)$data['id'] : null;
@@ -166,6 +176,7 @@ class SocialSharing_Networks_Controller extends SocialSharing_Core_BaseControlle
166
  }
167
 
168
  public function saveMailToDefaultAction(Rsc_Http_Request $request) {
 
169
  $projectId = (int)$request->post->get('project_id');
170
  $data = $request->post->get('data', array());
171
  $networkId = array_key_exists('id', $data) ? (int)$data['id'] : null;
@@ -183,6 +194,7 @@ class SocialSharing_Networks_Controller extends SocialSharing_Core_BaseControlle
183
 
184
  public function updateSortingAction(Rsc_Http_Request $request)
185
  {
 
186
  $projectId = $request->post->get('project_id');
187
  $positions = $request->post->get('positions');
188
  /** @var SocialSharing_Networks_Model_ProjectNetworks $projectNetworks */
11
  */
12
  public function allAction()
13
  {
14
+ if (!$this->_checkNonce($request)) die();
15
  $networks = $this->modelsFactory->get('networks')->all();
16
 
17
  return $this->response(
26
  */
27
  public function addToProjectAction(Rsc_Http_Request $request)
28
  {
29
+ if (!$this->_checkNonce($request)) die();
30
  $networks = $request->post->get('networks');
31
  $projectId = $request->post->get('project_id');
32
 
48
  */
49
  public function incrementAction(Rsc_Http_Request $request)
50
  {
51
+ if (!$this->_checkNonce($request)) die();
52
  $id = $request->post->get('id');
53
  $this->modelsFactory->get('networks')->incrementTotalShares($id);
54
 
56
  }
57
 
58
  public function saveTooltipsAction(Rsc_Http_Request $request) {
59
+ if (!$this->_checkNonce($request)) die();
60
  $projectId = (int)$request->post->get('project_id');
61
  $data = $request->post->get('data', array());
62
  $networkId = array_key_exists('id', $data) ? (int)$data['id'] : null;
73
  }
74
 
75
  public function saveTitlesAction(Rsc_Http_Request $request) {
76
+ if (!$this->_checkNonce($request)) die();
77
  $projectId = (int)$request->post->get('project_id');
78
  $data = $request->post->get('data', array());
79
  $networkId = array_key_exists('id', $data) ? (int)$data['id'] : null;
90
  }
91
 
92
  public function saveProfileNameAction(Rsc_Http_Request $request) {
93
+ if (!$this->_checkNonce($request)) die();
94
  $projectId = (int)$request->post->get('project_id');
95
  $data = $request->post->get('data', array());
96
  $networkId = array_key_exists('id', $data) ? (int)$data['id'] : null;
107
  }
108
 
109
  public function saveIconImageAction(Rsc_Http_Request $request) {
110
+ if (!$this->_checkNonce($request)) die();
111
  $projectId = (int)$request->post->get('project_id');
112
  $data = $request->post->get('data', array());
113
  $networkId = array_key_exists('id', $data) ? (int) $data['id'] : null;
125
  }
126
 
127
  public function saveTextFormatAction(Rsc_Http_Request $request) {
128
+ if (!$this->_checkNonce($request)) die();
129
  $projectId = (int)$request->post->get('project_id');
130
  $data = $request->post->get('data', array());
131
  $networkId = array_key_exists('id', $data) ? (int)$data['id'] : null;
142
  }
143
 
144
  public function saveUseShortUrlAction(Rsc_Http_Request $request) {
145
+ if (!$this->_checkNonce($request)) die();
146
  $projectId = (int)$request->post->get('project_id');
147
  $data = $request->post->get('data', array());
148
  $networkId = array_key_exists('id', $data) ? (int)$data['id'] : null;
159
  }
160
 
161
  public function saveNamesAction(Rsc_Http_Request $request) {
162
+ if (!$this->_checkNonce($request)) die();
163
  $projectId = (int)$request->post->get('project_id');
164
  $data = $request->post->get('data', array());
165
  $networkId = array_key_exists('id', $data) ? (int)$data['id'] : null;
176
  }
177
 
178
  public function saveMailToDefaultAction(Rsc_Http_Request $request) {
179
+ if (!$this->_checkNonce($request)) die();
180
  $projectId = (int)$request->post->get('project_id');
181
  $data = $request->post->get('data', array());
182
  $networkId = array_key_exists('id', $data) ? (int)$data['id'] : null;
194
 
195
  public function updateSortingAction(Rsc_Http_Request $request)
196
  {
197
+ if (!$this->_checkNonce($request)) die();
198
  $projectId = $request->post->get('project_id');
199
  $positions = $request->post->get('positions');
200
  /** @var SocialSharing_Networks_Model_ProjectNetworks $projectNetworks */
src/SocialSharing/Overview/Controller.php CHANGED
@@ -23,6 +23,7 @@ class SocialSharing_Overview_Controller extends SocialSharing_Core_BaseControlle
23
  }
24
 
25
  public function sendMailAction(Rsc_Http_Request $request) {
 
26
  $mail = $request->post->get('mail');
27
  $headers = 'From: ' . $mail['name'] . ' ' . $mail['email'] . "\r\n" . 'Website: ' . $mail['website'] . "\r\n" . 'Question: ' . $mail['question'] . "\r\n";
28
  $config = $this->getEnvironment()->getConfig();
@@ -56,4 +57,4 @@ class SocialSharing_Overview_Controller extends SocialSharing_Core_BaseControlle
56
 
57
  return $news;
58
  }
59
- }
23
  }
24
 
25
  public function sendMailAction(Rsc_Http_Request $request) {
26
+ if (!$this->_checkNonce($request)) die();
27
  $mail = $request->post->get('mail');
28
  $headers = 'From: ' . $mail['name'] . ' ' . $mail['email'] . "\r\n" . 'Website: ' . $mail['website'] . "\r\n" . 'Question: ' . $mail['question'] . "\r\n";
29
  $config = $this->getEnvironment()->getConfig();
57
 
58
  return $news;
59
  }
60
+ }
src/SocialSharing/Overview/Module.php CHANGED
@@ -73,4 +73,4 @@ class SocialSharing_Overview_Module extends Rsc_Mvc_Module
73
 
74
  $menu->addSubmenuItem('ovewrview', $submenu);
75
  }
76
- }
73
 
74
  $menu->addSubmenuItem('ovewrview', $submenu);
75
  }
76
+ }
src/SocialSharing/Overview/assets/js/overview-settings.js CHANGED
@@ -52,4 +52,4 @@
52
 
53
  controller.init();
54
  });
55
- })(jQuery);
52
 
53
  controller.init();
54
  });
55
+ })(jQuery);
src/SocialSharing/Overview/views/form.twig CHANGED
@@ -141,4 +141,6 @@
141
  <span name="{{ name }}" {% for attribute, value in attributes %}{{ attribute }}="{{ value }}"{% endfor %}>
142
  {{ text|lower }}
143
  </span>
144
- {% endmacro %}
 
 
141
  <span name="{{ name }}" {% for attribute, value in attributes %}{{ attribute }}="{{ value }}"{% endfor %}>
142
  {{ text|lower }}
143
  </span>
144
+ {% endmacro %}
145
+
146
+ <input type="hidden" name="route[nonce]" value="{{ environment.getNonce() }}" />
src/SocialSharing/Overview/views/index.twig CHANGED
@@ -108,6 +108,7 @@
108
  form.text('mail[website]', user.url, { 'style': { 'width': 'auto;' } })) }}
109
  {{ form.row(environment.translate('Subject'),
110
  form.text('mail[subject]', '', { 'style': { 'width': 'auto;' } })) }}
 
111
  <tr>
112
  <th scope="row">
113
  <label for="select-question">{{ environment.translate('Topic') }}</label>
@@ -149,4 +150,4 @@
149
  </div>
150
  </div>
151
  </div>
152
- {% endblock %}
108
  form.text('mail[website]', user.url, { 'style': { 'width': 'auto;' } })) }}
109
  {{ form.row(environment.translate('Subject'),
110
  form.text('mail[subject]', '', { 'style': { 'width': 'auto;' } })) }}
111
+ <input type="hidden" name="route[nonce]" value="{{ environment.getNonce() }}" />
112
  <tr>
113
  <th scope="row">
114
  <label for="select-question">{{ environment.translate('Topic') }}</label>
150
  </div>
151
  </div>
152
  </div>
153
+ {% endblock %}
src/SocialSharing/Projects/Controller.php CHANGED
@@ -50,7 +50,6 @@ class SocialSharing_Projects_Controller extends SocialSharing_Core_BaseControlle
50
 
51
  if(empty($title) || empty($title)) {
52
  $buttonsPreview = $this->getModelsFactory()->get('projects')->getButtonsDesignPreview();
53
-
54
  return $this->response('@projects/add_new.twig',
55
  array(
56
  'buttons_preview' => $buttonsPreview,
@@ -58,6 +57,7 @@ class SocialSharing_Projects_Controller extends SocialSharing_Core_BaseControlle
58
  )
59
  );
60
  } else {
 
61
  try {
62
  $insertId = $this->modelsFactory->get('projects')->create(
63
  $title,
@@ -79,7 +79,8 @@ class SocialSharing_Projects_Controller extends SocialSharing_Core_BaseControlle
79
  'projects',
80
  'view',
81
  array(
82
- 'id' => $insertId
 
83
  )
84
  )
85
  ));
@@ -92,6 +93,7 @@ class SocialSharing_Projects_Controller extends SocialSharing_Core_BaseControlle
92
  */
93
  public function saveAction(Rsc_Http_Request $request)
94
  {
 
95
  $id = $request->post->get('id');
96
  $settings = $request->post->get('settings');
97
  $projects = $this->modelsFactory->get('projects');
@@ -146,6 +148,7 @@ class SocialSharing_Projects_Controller extends SocialSharing_Core_BaseControlle
146
  */
147
  public function viewAction(Rsc_Http_Request $request)
148
  {
 
149
  $projectId = (int)$request->query->get('id');
150
 
151
  $project = $this->modelsFactory->get('projects')->get($projectId);
@@ -153,7 +156,7 @@ class SocialSharing_Projects_Controller extends SocialSharing_Core_BaseControlle
153
  $tooltips = $this->modelsFactory->get('projects')->getTooltips();
154
  $buttonsPreview = $this->getModelsFactory()->get('projects')->getButtonsDesignPreview();
155
  $sharesModel = $this->getEnvironment()->getModule('shares')->getModelsFactory()->get('shares');
156
-
157
  $popup = $this->getEnvironment()->getModule('popup');
158
  $popupInstalled = $popup->isInstalled();
159
  $popups = $popupInstalled ? $popup->getModel()->getSimpleList('original_id != 0') : array();
@@ -244,6 +247,7 @@ class SocialSharing_Projects_Controller extends SocialSharing_Core_BaseControlle
244
  */
245
  public function deleteAction(Rsc_Http_Request $request)
246
  {
 
247
  $this->modelsFactory->get('projects')->delete($request->query->get('id'));
248
 
249
  return $this->redirect($this->generateUrl('projects', 'index'));
@@ -251,6 +255,7 @@ class SocialSharing_Projects_Controller extends SocialSharing_Core_BaseControlle
251
 
252
  public function renameAction(Rsc_Http_Request $request)
253
  {
 
254
  try {
255
  $projects = $this->modelsFactory->get('projects');
256
 
@@ -267,6 +272,7 @@ class SocialSharing_Projects_Controller extends SocialSharing_Core_BaseControlle
267
 
268
  public function cloneAction(Rsc_Http_Request $request)
269
  {
 
270
  $id = $request->post->get('id', $request->query->get('id'));
271
 
272
  try {
@@ -315,6 +321,7 @@ class SocialSharing_Projects_Controller extends SocialSharing_Core_BaseControlle
315
 
316
  public function removeNetworkAction(Rsc_Http_Request $request)
317
  {
 
318
  /** @var int $networkId */
319
  $networkId = (int) $request->post->get('network_id');
320
  /** @var int $projectId */
50
 
51
  if(empty($title) || empty($title)) {
52
  $buttonsPreview = $this->getModelsFactory()->get('projects')->getButtonsDesignPreview();
 
53
  return $this->response('@projects/add_new.twig',
54
  array(
55
  'buttons_preview' => $buttonsPreview,
57
  )
58
  );
59
  } else {
60
+ if (!$this->_checkNonce($request)) die();
61
  try {
62
  $insertId = $this->modelsFactory->get('projects')->create(
63
  $title,
79
  'projects',
80
  'view',
81
  array(
82
+ 'id' => $insertId,
83
+ 'nonce' => $this->getEnvironment()->getNonce()
84
  )
85
  )
86
  ));
93
  */
94
  public function saveAction(Rsc_Http_Request $request)
95
  {
96
+ if (!$this->_checkNonce($request)) die();
97
  $id = $request->post->get('id');
98
  $settings = $request->post->get('settings');
99
  $projects = $this->modelsFactory->get('projects');
148
  */
149
  public function viewAction(Rsc_Http_Request $request)
150
  {
151
+ if (!$this->_checkNonce($request)) die();
152
  $projectId = (int)$request->query->get('id');
153
 
154
  $project = $this->modelsFactory->get('projects')->get($projectId);
156
  $tooltips = $this->modelsFactory->get('projects')->getTooltips();
157
  $buttonsPreview = $this->getModelsFactory()->get('projects')->getButtonsDesignPreview();
158
  $sharesModel = $this->getEnvironment()->getModule('shares')->getModelsFactory()->get('shares');
159
+
160
  $popup = $this->getEnvironment()->getModule('popup');
161
  $popupInstalled = $popup->isInstalled();
162
  $popups = $popupInstalled ? $popup->getModel()->getSimpleList('original_id != 0') : array();
247
  */
248
  public function deleteAction(Rsc_Http_Request $request)
249
  {
250
+ if (!$this->_checkNonce($request)) die();
251
  $this->modelsFactory->get('projects')->delete($request->query->get('id'));
252
 
253
  return $this->redirect($this->generateUrl('projects', 'index'));
255
 
256
  public function renameAction(Rsc_Http_Request $request)
257
  {
258
+ if (!$this->_checkNonce($request)) die();
259
  try {
260
  $projects = $this->modelsFactory->get('projects');
261
 
272
 
273
  public function cloneAction(Rsc_Http_Request $request)
274
  {
275
+ if (!$this->_checkNonce($request)) die();
276
  $id = $request->post->get('id', $request->query->get('id'));
277
 
278
  try {
321
 
322
  public function removeNetworkAction(Rsc_Http_Request $request)
323
  {
324
+ if (!$this->_checkNonce($request)) die();
325
  /** @var int $networkId */
326
  $networkId = (int) $request->post->get('network_id');
327
  /** @var int $projectId */
src/SocialSharing/Projects/Module.php CHANGED
@@ -19,9 +19,9 @@ class SocialSharing_Projects_Module extends SocialSharing_Core_BaseModule
19
  $this->registerMenu();
20
  $dispatcher = $this->getEnvironment()->getDispatcher();
21
  $dispatcher->on('after_ui_loaded', array($this, 'onUiLoaded'));
22
- if(!is_admin() && !defined( 'DOING_AJAX' )) {
23
- $dispatcher->on('after_modules_loaded', array($this, 'doFrontendStuff'));
24
- }
25
 
26
  $projects = $this->getController()->getModelsFactory()->get('projects');
27
 
@@ -33,15 +33,16 @@ class SocialSharing_Projects_Module extends SocialSharing_Core_BaseModule
33
  $this->checkOldProVersion();
34
 
35
  add_action('init', array($this, 'wpInitCallback'));
36
- add_action( 'wp_enqueue_scripts',array($this, 'localizeData'));
37
- add_action('widgets_init', array($this, 'applyWidgetCallback'));
 
38
  }
39
 
40
  public function localizeData()
41
  {
42
  wp_localize_script( 'jquery', 'theme_data', array('themeLogo' => wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ))));
43
  }
44
-
45
  /** Filters pro options and returns options for button or icon (if $params[1] == true)
46
  * @param mixed
47
  * @return mixed
19
  $this->registerMenu();
20
  $dispatcher = $this->getEnvironment()->getDispatcher();
21
  $dispatcher->on('after_ui_loaded', array($this, 'onUiLoaded'));
22
+ if(!is_admin() && !defined( 'DOING_AJAX' )) {
23
+ $dispatcher->on('after_modules_loaded', array($this, 'doFrontendStuff'));
24
+ }
25
 
26
  $projects = $this->getController()->getModelsFactory()->get('projects');
27
 
33
  $this->checkOldProVersion();
34
 
35
  add_action('init', array($this, 'wpInitCallback'));
36
+ add_action('wp_enqueue_scripts',array($this, 'localizeData'));
37
+ add_action('widgets_init', array($this, 'applyWidgetCallback'));
38
+
39
  }
40
 
41
  public function localizeData()
42
  {
43
  wp_localize_script( 'jquery', 'theme_data', array('themeLogo' => wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ))));
44
  }
45
+
46
  /** Filters pro options and returns options for button or icon (if $params[1] == true)
47
  * @param mixed
48
  * @return mixed
src/SocialSharing/Projects/assets/js/projects.edit.js CHANGED
@@ -229,6 +229,7 @@
229
  'module': 'networks',
230
  'action': 'updateSorting'
231
  },
 
232
  'project_id': parseInt($('#networks [name="project_id"]').val()),
233
  'positions': networksPositions
234
  }).done(function(response) {
@@ -941,6 +942,7 @@
941
  'module': 'networks',
942
  'action': 'saveNames'
943
  },
 
944
  'project_id': parseInt($('#networks [name="project_id"]').val()),
945
  'data': { 'id': networkId, 'value': name }
946
  }).done(function(response) {
@@ -1468,13 +1470,13 @@
1468
  }
1469
  }
1470
  })
1471
-
1472
  jQuery('.disableClick input').attr("disabled", true);
1473
  jQuery('.disableClick select').attr("disabled", true);
1474
  jQuery('.disableClick .wp-color-result').off('click').on('click',function (e) {
1475
  e.preventDefault();
1476
  });
1477
-
1478
  });
1479
 
1480
  }(window.jQuery, window.supsystic.SocialSharing));
229
  'module': 'networks',
230
  'action': 'updateSorting'
231
  },
232
+ 'nonce': SSBS_NONCE,
233
  'project_id': parseInt($('#networks [name="project_id"]').val()),
234
  'positions': networksPositions
235
  }).done(function(response) {
942
  'module': 'networks',
943
  'action': 'saveNames'
944
  },
945
+ 'nonce': SSBS_NONCE,
946
  'project_id': parseInt($('#networks [name="project_id"]').val()),
947
  'data': { 'id': networkId, 'value': name }
948
  }).done(function(response) {
1470
  }
1471
  }
1472
  })
1473
+
1474
  jQuery('.disableClick input').attr("disabled", true);
1475
  jQuery('.disableClick select').attr("disabled", true);
1476
  jQuery('.disableClick .wp-color-result').off('click').on('click',function (e) {
1477
  e.preventDefault();
1478
  });
1479
+
1480
  });
1481
 
1482
  }(window.jQuery, window.supsystic.SocialSharing));
src/SocialSharing/Projects/views/add.twig CHANGED
@@ -46,6 +46,7 @@
46
  type="hidden"/>
47
  <input name="route[action]" value="addToProject"
48
  type="hidden"/>
 
49
  <input name="project_id"
50
  value="{{ project.id }}" type="hidden"/>
51
 
@@ -93,6 +94,7 @@
93
  <input name="route[action]" type="hidden" value="save"/>
94
  <input name="settings[popup_id]" id="popupId" value="{{ project.settings.popup_id | default(0) }}" type="hidden"/>
95
  <input name="settings[map_id]" id="gmapId" value="{{ project.settings.map_id | default(0) }}" type="hidden"/>
 
96
 
97
  <div class="scroll" data-navigation="design" hidden>
98
  <div class="half-page-left" style="float: left; width: 50%; padding-right: 25px;">
46
  type="hidden"/>
47
  <input name="route[action]" value="addToProject"
48
  type="hidden"/>
49
+ <input type="hidden" name="route[nonce]" value="{{ environment.getNonce() }}" />
50
  <input name="project_id"
51
  value="{{ project.id }}" type="hidden"/>
52
 
94
  <input name="route[action]" type="hidden" value="save"/>
95
  <input name="settings[popup_id]" id="popupId" value="{{ project.settings.popup_id | default(0) }}" type="hidden"/>
96
  <input name="settings[map_id]" id="gmapId" value="{{ project.settings.map_id | default(0) }}" type="hidden"/>
97
+ <input type="hidden" name="route[nonce]" value="{{ environment.getNonce() }}" />
98
 
99
  <div class="scroll" data-navigation="design" hidden>
100
  <div class="half-page-left" style="float: left; width: 50%; padding-right: 25px;">
src/SocialSharing/Projects/views/macro/preview.twig CHANGED
@@ -5,7 +5,7 @@
5
  <th scope="row">
6
  <input type="radio" name="settings[design]" value="{{ design }}" {% if project.settings.design | default('flat-1') == design %}checked="checked"{% endif %} id="{{ design }}"/>
7
  {%- for button in networks -%}
8
- <a class="pricon social-sharing-button sharer-{{ builder }} sharer-{{ design }} {{ button }} counter-{{ project.settings.shares_style | default('standard') }} {% if project.settings.display_total_shares is not defined %}without-counter{% endif %}"
9
  href="javascript:void(0);">
10
  <i class="fa-ssbs fa-ssbs-fw fa-ssbs-{{ button }}">
11
  {% if hasText | length and number in hasText %}
@@ -13,7 +13,7 @@
13
  {% endif %}
14
  </i>
15
 
16
- <div class="counter-wrap {{ project.settings.shares_style | default('standard') }}">
17
  <span class="counter">
18
  {%- if project.settings.short_numbers == 'on' -%}
19
  5.7k
5
  <th scope="row">
6
  <input type="radio" name="settings[design]" value="{{ design }}" {% if project.settings.design | default('flat-1') == design %}checked="checked"{% endif %} id="{{ design }}"/>
7
  {%- for button in networks -%}
8
+ <a class="pricon social-sharing-button sharer-{{ builder }} {{' '}} sharer-{{ design }} {{' '}} {{ button }} {{' '}} counter-{{ project.settings.shares_style | default('standard') }} {{' '}} {% if project.settings.display_total_shares is not defined %}without-counter{% endif %}"
9
  href="javascript:void(0);">
10
  <i class="fa-ssbs fa-ssbs-fw fa-ssbs-{{ button }}">
11
  {% if hasText | length and number in hasText %}
13
  {% endif %}
14
  </i>
15
 
16
+ <div class="counter-wrap {{' '}} {{ project.settings.shares_style | default('standard') }}">
17
  <span class="counter">
18
  {%- if project.settings.short_numbers == 'on' -%}
19
  5.7k
src/SocialSharing/Projects/views/view.twig CHANGED
@@ -55,4 +55,4 @@
55
  <i class="fa fa-eye"></i>
56
  {{ environment.translate('Get Pro') }}
57
  </button>#}
58
- {% endblock %}
55
  <i class="fa fa-eye"></i>
56
  {{ environment.translate('Get Pro') }}
57
  </button>#}
58
+ {% endblock %}
src/SocialSharing/Promo/Controller.php CHANGED
@@ -16,8 +16,8 @@ class SocialSharing_Promo_Controller extends SocialSharing_Core_BaseController
16
  array(
17
  'plugin_name' => $this->getEnvironment()->getConfig()->get('plugin_title_name'),
18
  'plugin_version' => $this->getEnvironment()->getConfig()->get('plugin_version'),
19
- 'start_url' => '?page=supsystic-social-sharing&module=projects&action=add'
20
  )
21
  );
22
  }
23
- }
16
  array(
17
  'plugin_name' => $this->getEnvironment()->getConfig()->get('plugin_title_name'),
18
  'plugin_version' => $this->getEnvironment()->getConfig()->get('plugin_version'),
19
+ 'start_url' => '?page=supsystic-social-sharing&module=projects&action=add'.'&nonce='.wp_create_nonce('ssbs_nonce')
20
  )
21
  );
22
  }
23
+ }
src/SocialSharing/Shares/Controller.php CHANGED
@@ -10,6 +10,7 @@ class SocialSharing_Shares_Controller extends SocialSharing_Core_BaseController
10
  */
11
  public function saveAction(Rsc_Http_Request $request)
12
  {
 
13
  $projectId = $request->post->get('project_id');
14
  $networkId = $request->post->get('network_id');
15
  $postId = $request->post->get('post_id');
@@ -49,6 +50,7 @@ class SocialSharing_Shares_Controller extends SocialSharing_Core_BaseController
49
 
50
  public function setOptionEnableStatAction(Rsc_Http_Request $request)
51
  {
 
52
  $isEnable = (bool) $request->post->get('isEnable');
53
 
54
  $shares = $this->modelsFactory->get('shares');
@@ -60,6 +62,7 @@ class SocialSharing_Shares_Controller extends SocialSharing_Core_BaseController
60
 
61
  public function setOptionViewsLogAction(Rsc_Http_Request $request)
62
  {
 
63
  $shares = $this->modelsFactory->get('shares');
64
 
65
  $shares->setViewsLogOption($request->post->get('isEnable'));
@@ -69,6 +72,7 @@ class SocialSharing_Shares_Controller extends SocialSharing_Core_BaseController
69
 
70
  public function setOptionSharesLogAction(Rsc_Http_Request $request)
71
  {
 
72
  $shares = $this->modelsFactory->get('shares');
73
 
74
  $shares->setSharesLogOption($request->post->get('isEnable'));
@@ -78,6 +82,7 @@ class SocialSharing_Shares_Controller extends SocialSharing_Core_BaseController
78
 
79
  public function clearDataAction(Rsc_Http_Request $request)
80
  {
 
81
  $projectId = $request->post->get('project_id');
82
  $shares = $this->modelsFactory->get('shares');
83
  $views = $this->modelsFactory->get('views', 'shares');
@@ -90,6 +95,7 @@ class SocialSharing_Shares_Controller extends SocialSharing_Core_BaseController
90
 
91
  public function statisticAction(Rsc_Http_Request $request)
92
  {
 
93
  $project = $this->modelsFactory->get('projects')->get(
94
  $request->query->get('project_id')
95
  );
@@ -101,6 +107,7 @@ class SocialSharing_Shares_Controller extends SocialSharing_Core_BaseController
101
 
102
  public function getTotalSharesAction(Rsc_Http_Request $request)
103
  {
 
104
  try {
105
  /** @var SocialSharing_Shares_Model_Shares $shares */
106
  $shares = $this->modelsFactory->get('shares');
@@ -114,6 +121,7 @@ class SocialSharing_Shares_Controller extends SocialSharing_Core_BaseController
114
 
115
  public function getTotalViewsAction(Rsc_Http_Request $request)
116
  {
 
117
  try {
118
  /** @var SocialSharing_Shares_Model_Shares $shares */
119
  $views = $this->modelsFactory->get('views', 'shares');
@@ -127,6 +135,7 @@ class SocialSharing_Shares_Controller extends SocialSharing_Core_BaseController
127
 
128
  public function getTotalSharesByDaysAction(Rsc_Http_Request $request)
129
  {
 
130
  try {
131
  $days = $request->post->get('days', 30);
132
  $to = new DateTime();
@@ -155,6 +164,7 @@ class SocialSharing_Shares_Controller extends SocialSharing_Core_BaseController
155
 
156
  public function getPopularPagesByDaysAction(Rsc_Http_Request $request)
157
  {
 
158
  try {
159
  $days = $request->post->get('days', 30);
160
  $to = new DateTime();
@@ -190,6 +200,7 @@ class SocialSharing_Shares_Controller extends SocialSharing_Core_BaseController
190
 
191
  public function getPopularPagesByDaysViewsAction(Rsc_Http_Request $request)
192
  {
 
193
  try {
194
  $days = $request->post->get('days', 30);
195
  $to = new DateTime();
@@ -224,6 +235,7 @@ class SocialSharing_Shares_Controller extends SocialSharing_Core_BaseController
224
  }
225
 
226
  public function checkReviewNoticeAction(Rsc_Http_Request $request) {
 
227
  $showNotice = get_option('showSharingRevNotice');
228
  $show = false;
229
 
@@ -247,6 +259,7 @@ class SocialSharing_Shares_Controller extends SocialSharing_Core_BaseController
247
  }
248
 
249
  public function checkNoticeButtonAction(Rsc_Http_Request $request) {
 
250
  $code = $request->post->get('buttonCode');
251
  $showNotice = get_option('showSharingRevNotice');
252
 
@@ -264,7 +277,6 @@ class SocialSharing_Shares_Controller extends SocialSharing_Core_BaseController
264
 
265
  public function sendUsageStat($state) {
266
  $apiUrl = 'http://updates.supsystic.com';
267
-
268
  $reqUrl = $apiUrl . '?mod=options&action=saveUsageStat&pl=rcs';
269
  $res = wp_remote_post($reqUrl, array(
270
  'body' => array(
10
  */
11
  public function saveAction(Rsc_Http_Request $request)
12
  {
13
+ if (!$this->_checkNonce($request) && !$this->_checkNonceFrontend($request)) die();
14
  $projectId = $request->post->get('project_id');
15
  $networkId = $request->post->get('network_id');
16
  $postId = $request->post->get('post_id');
50
 
51
  public function setOptionEnableStatAction(Rsc_Http_Request $request)
52
  {
53
+ if (!$this->_checkNonce($request)) die();
54
  $isEnable = (bool) $request->post->get('isEnable');
55
 
56
  $shares = $this->modelsFactory->get('shares');
62
 
63
  public function setOptionViewsLogAction(Rsc_Http_Request $request)
64
  {
65
+ if (!$this->_checkNonce($request)) die();
66
  $shares = $this->modelsFactory->get('shares');
67
 
68
  $shares->setViewsLogOption($request->post->get('isEnable'));
72
 
73
  public function setOptionSharesLogAction(Rsc_Http_Request $request)
74
  {
75
+ if (!$this->_checkNonce($request)) die();
76
  $shares = $this->modelsFactory->get('shares');
77
 
78
  $shares->setSharesLogOption($request->post->get('isEnable'));
82
 
83
  public function clearDataAction(Rsc_Http_Request $request)
84
  {
85
+ if (!$this->_checkNonce($request)) die();
86
  $projectId = $request->post->get('project_id');
87
  $shares = $this->modelsFactory->get('shares');
88
  $views = $this->modelsFactory->get('views', 'shares');
95
 
96
  public function statisticAction(Rsc_Http_Request $request)
97
  {
98
+ if (!$this->_checkNonce($request)) die();
99
  $project = $this->modelsFactory->get('projects')->get(
100
  $request->query->get('project_id')
101
  );
107
 
108
  public function getTotalSharesAction(Rsc_Http_Request $request)
109
  {
110
+ if (!$this->_checkNonce($request)) die();
111
  try {
112
  /** @var SocialSharing_Shares_Model_Shares $shares */
113
  $shares = $this->modelsFactory->get('shares');
121
 
122
  public function getTotalViewsAction(Rsc_Http_Request $request)
123
  {
124
+ if (!$this->_checkNonce($request)) die();
125
  try {
126
  /** @var SocialSharing_Shares_Model_Shares $shares */
127
  $views = $this->modelsFactory->get('views', 'shares');
135
 
136
  public function getTotalSharesByDaysAction(Rsc_Http_Request $request)
137
  {
138
+ if (!$this->_checkNonce($request)) die();
139
  try {
140
  $days = $request->post->get('days', 30);
141
  $to = new DateTime();
164
 
165
  public function getPopularPagesByDaysAction(Rsc_Http_Request $request)
166
  {
167
+ if (!$this->_checkNonce($request)) die();
168
  try {
169
  $days = $request->post->get('days', 30);
170
  $to = new DateTime();
200
 
201
  public function getPopularPagesByDaysViewsAction(Rsc_Http_Request $request)
202
  {
203
+ if (!$this->_checkNonce($request)) die();
204
  try {
205
  $days = $request->post->get('days', 30);
206
  $to = new DateTime();
235
  }
236
 
237
  public function checkReviewNoticeAction(Rsc_Http_Request $request) {
238
+ if (!$this->_checkNonce($request)) die();
239
  $showNotice = get_option('showSharingRevNotice');
240
  $show = false;
241
 
259
  }
260
 
261
  public function checkNoticeButtonAction(Rsc_Http_Request $request) {
262
+ if (!$this->_checkNonce($request)) die();
263
  $code = $request->post->get('buttonCode');
264
  $showNotice = get_option('showSharingRevNotice');
265
 
277
 
278
  public function sendUsageStat($state) {
279
  $apiUrl = 'http://updates.supsystic.com';
 
280
  $reqUrl = $apiUrl . '?mod=options&action=saveUsageStat&pl=rcs';
281
  $res = wp_remote_post($reqUrl, array(
282
  'body' => array(
src/SocialSharing/Shares/assets/js/share.js CHANGED
@@ -17,6 +17,7 @@
17
  data.project_id = projectId;
18
  data.network_id = networkId;
19
  data.post_id = isNaN(postId) ? null : postId;
 
20
 
21
  if (additionalObjectCode == 'mbs') {
22
  var additionalObjectItemId = parseInt($button.attr('data-plugin-item-id'))
17
  data.project_id = projectId;
18
  data.network_id = networkId;
19
  data.post_id = isNaN(postId) ? null : postId;
20
+ data.nonce = SSBS_NONCE_FRONTEND;
21
 
22
  if (additionalObjectCode == 'mbs') {
23
  var additionalObjectItemId = parseInt($button.attr('data-plugin-item-id'))
src/SocialSharing/Shares/assets/js/shares.statistic.js CHANGED
@@ -1,5 +1,5 @@
1
  (function ($, app) {
2
-
3
  var getTotalSharesByDays = function (days) {
4
  return app.request({
5
  module: 'shares',
@@ -206,14 +206,15 @@
206
  };
207
 
208
  var ssbShowReviewNotice = function() {
209
-
210
  $.post(window.ajaxurl,
211
  {
212
  action: 'social-sharing',
 
213
  route: {
214
  module: 'shares',
215
  action: 'checkReviewNotice'
216
  }
 
217
  })
218
  .success(function (response) {
219
 
@@ -320,5 +321,5 @@
320
 
321
  ssbShowReviewNotice();
322
  });
323
-
324
  }(jQuery, window.supsystic.SocialSharing));
1
  (function ($, app) {
2
+ $(document).ready(function () {
3
  var getTotalSharesByDays = function (days) {
4
  return app.request({
5
  module: 'shares',
206
  };
207
 
208
  var ssbShowReviewNotice = function() {
 
209
  $.post(window.ajaxurl,
210
  {
211
  action: 'social-sharing',
212
+ nonce: SSBS_NONCE,
213
  route: {
214
  module: 'shares',
215
  action: 'checkReviewNotice'
216
  }
217
+
218
  })
219
  .success(function (response) {
220
 
321
 
322
  ssbShowReviewNotice();
323
  });
324
+ });
325
  }(jQuery, window.supsystic.SocialSharing));
src/SocialSharing/Tester/Controller.php CHANGED
@@ -12,6 +12,7 @@ class SocialSharing_Tester_Controller extends SocialSharing_Core_BaseController
12
 
13
  public function updateAction(Rsc_Http_Request $request)
14
  {
 
15
  $id = $request->post->get('project');
16
  $count = $request->post->get('count');
17
  $networks = $this->modelsFactory->get('networks')->all();
@@ -27,4 +28,4 @@ class SocialSharing_Tester_Controller extends SocialSharing_Core_BaseController
27
 
28
  return $this->redirect($this->generateUrl('tester', 'index', array('notice' => true)));
29
  }
30
- }
12
 
13
  public function updateAction(Rsc_Http_Request $request)
14
  {
15
+ if (!$this->_checkNonce($request)) die();
16
  $id = $request->post->get('project');
17
  $count = $request->post->get('count');
18
  $networks = $this->modelsFactory->get('networks')->all();
28
 
29
  return $this->redirect($this->generateUrl('tester', 'index', array('notice' => true)));
30
  }
31
+ }
src/SocialSharing/Ui/Module.php CHANGED
@@ -56,9 +56,29 @@ class SocialSharing_Ui_Module extends SocialSharing_Core_BaseModule
56
  ->setLocalSource('css/admin.css')
57
  );
58
 
 
 
 
59
  $this->getEnvironment()
60
  ->getDispatcher()
61
  ->on('after_modules_loaded', array($this, 'registerAssets'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  }
63
 
64
  /**
@@ -143,4 +163,4 @@ class SocialSharing_Ui_Module extends SocialSharing_Core_BaseModule
143
 
144
  return $asset;
145
  }
146
- }
56
  ->setLocalSource('css/admin.css')
57
  );
58
 
59
+ add_action('admin_enqueue_scripts',array($this, 'addNonce'));
60
+ add_action('wp_enqueue_scripts',array($this, 'addNonce'));
61
+
62
  $this->getEnvironment()
63
  ->getDispatcher()
64
  ->on('after_modules_loaded', array($this, 'registerAssets'));
65
+
66
+ }
67
+
68
+ public function addNonce()
69
+ {
70
+ if ( is_admin() && current_user_can('administrator') ) {
71
+ $nonce = wp_create_nonce('ssbs_nonce');
72
+ wp_register_script( 'ssbs-nonce', '' );
73
+ wp_enqueue_script( 'ssbs-nonce' );
74
+ wp_add_inline_script( 'ssbs-nonce', 'var SSBS_NONCE = "'.$nonce.'"' );
75
+ }
76
+ if ( !is_admin() ) {
77
+ $nonce = wp_create_nonce('ssbs_nonce_frontend');
78
+ wp_register_script( 'ssbs-nonce', '' );
79
+ wp_enqueue_script( 'ssbs-nonce' );
80
+ wp_add_inline_script( 'ssbs-nonce', 'var SSBS_NONCE_FRONTEND = "'.$nonce.'"' );
81
+ }
82
  }
83
 
84
  /**
163
 
164
  return $asset;
165
  }
166
+ }
vendor/Rsc/Environment.php CHANGED
@@ -383,13 +383,37 @@ class Rsc_Environment
383
  $url .= '&' . http_build_query($parameters, '', '&');
384
  }
385
 
386
- if(!empty($hash)) {
387
- $url .= '#'. $hash;
388
- }
389
-
390
- return $url;
391
- }
392
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
393
  /**
394
  * Returns an instance of the specified module
395
  * @param string $module The name of the module
383
  $url .= '&' . http_build_query($parameters, '', '&');
384
  }
385
 
386
+ if(!empty($hash)) {
387
+ $url .= '#'. $hash;
388
+ }
389
+
390
+ $pluginName = $this->config->get('plugin_name');
391
+ if ($pluginName === 'sss') {
392
+ $url .= '&nonce='.wp_create_nonce('ssbs_nonce');
393
+ return $url;
394
+ } else {
395
+ $url .= '&nonce='.wp_create_nonce('dtgs_nonce');
396
+ return $url;
397
+ }
398
+ }
399
+ public function getNonceFrontend()
400
+ {
401
+ $pluginName = $this->config->get('plugin_name');
402
+ if ($pluginName === 'sss') {
403
+ return wp_create_nonce('ssbs_nonce_frontend');
404
+ } else {
405
+ return wp_create_nonce('dtgs_nonce_frontend');
406
+ }
407
+ }
408
+ public function getNonce()
409
+ {
410
+ $pluginName = $this->config->get('plugin_name');
411
+ if ($pluginName === 'sss') {
412
+ return wp_create_nonce('ssbs_nonce');
413
+ } else {
414
+ return wp_create_nonce('dtgs_nonce');
415
+ }
416
+ }
417
  /**
418
  * Returns an instance of the specified module
419
  * @param string $module The name of the module
vendor/Rsc/Menu/Item.php CHANGED
@@ -180,4 +180,4 @@ class Rsc_Menu_Item
180
  call_user_func_array('add_submenu_page', $parameters);
181
  $this->resolver->setRoute($this->menuSlug, $this->moduleName);
182
  }
183
- }
180
  call_user_func_array('add_submenu_page', $parameters);
181
  $this->resolver->setRoute($this->menuSlug, $this->moduleName);
182
  }
183
+ }
vendor/Rsc/Menu/Page.php CHANGED
@@ -233,7 +233,7 @@ class Rsc_Menu_Page
233
  }
234
  }
235
  }
236
-
237
  public function sortSubMenuItemsClb($a, $b) {
238
  $sortOrderA = $a->getSortOrder();
239
  $sortOrderB = $b->getSortOrder();
@@ -265,4 +265,4 @@ class Rsc_Menu_Page
265
 
266
  return call_user_func_array('add_menu_page', $parameters);
267
  }
268
- }
233
  }
234
  }
235
  }
236
+
237
  public function sortSubMenuItemsClb($a, $b) {
238
  $sortOrderA = $a->getSortOrder();
239
  $sortOrderB = $b->getSortOrder();
265
 
266
  return call_user_func_array('add_menu_page', $parameters);
267
  }
268
+ }