Photo Gallery by Supsystic - Version 1.15.8

Version Description

Download this release

Release Info

Developer supsystic.com
Plugin Icon 128x128 Photo Gallery by Supsystic
Version 1.15.8
Comparing to
See all releases

Code changes from version 1.15.7 to 1.15.8

index.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Plugin Name: Photo Gallery by Supsystic
5
  * Description: Easy to use Gallery by Supsystic with professional gallery templates. Show off your best design, photography and creative work
6
- * Version: 1.15.7
7
  * Author: supsystic.com
8
  * Author URI: https://supsystic.com
9
  * Text Domain: grid-gallery
@@ -15,5 +15,5 @@ if (!defined('SG_PLUGIN_URL')) {
15
  define('SG_PLUGIN_URL', plugin_dir_url( __FILE__ ));
16
  }
17
 
18
- $supsysticGallery = new SupsysticGallery('1.15.7');
19
  $supsysticGallery->run();
3
  /**
4
  * Plugin Name: Photo Gallery by Supsystic
5
  * Description: Easy to use Gallery by Supsystic with professional gallery templates. Show off your best design, photography and creative work
6
+ * Version: 1.15.8
7
  * Author: supsystic.com
8
  * Author URI: https://supsystic.com
9
  * Text Domain: grid-gallery
15
  define('SG_PLUGIN_URL', plugin_dir_url( __FILE__ ));
16
  }
17
 
18
+ $supsysticGallery = new SupsysticGallery('1.15.8');
19
  $supsysticGallery->run();
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: supsystic.com
3
  Donate link: https://supsystic.com/plugins/gallery
4
  Tags: gallery, wordpress gallery plugin, photo gallery, grid gallery, image gallery, video gallery, responsive gallery, polaroid gallery
5
  Tested up to: 6.0
6
- Stable tag: 1.15.7
7
 
8
  Photo Gallery with template editor to build amazing media gallery. Responsive mobile gallery with grid, masonry, carousel, polaroid and more gallery
9
 
@@ -176,6 +176,9 @@ Add watermark on each image in your gallery and you protect your photos from the
176
  14. Photo gallery plugin admin area. Captions and Icons tab. Create impressive gallery with icons and fantastic caption effect.
177
 
178
  == Changelog ==
 
 
 
179
  = Gallery 1.15.7 / 27.06.2022 =
180
  * Fixes for WP review Team
181
 
3
  Donate link: https://supsystic.com/plugins/gallery
4
  Tags: gallery, wordpress gallery plugin, photo gallery, grid gallery, image gallery, video gallery, responsive gallery, polaroid gallery
5
  Tested up to: 6.0
6
+ Stable tag: 1.15.8
7
 
8
  Photo Gallery with template editor to build amazing media gallery. Responsive mobile gallery with grid, masonry, carousel, polaroid and more gallery
9
 
176
  14. Photo gallery plugin admin area. Captions and Icons tab. Create impressive gallery with icons and fantastic caption effect.
177
 
178
  == Changelog ==
179
+ = Gallery 1.15.8 / 02.07.2022 =
180
+ * Fixes for WP review Team
181
+
182
  = Gallery 1.15.7 / 27.06.2022 =
183
  * Fixes for WP review Team
184
 
src/GridGallery/Featuredplugins/Controller.php CHANGED
@@ -35,7 +35,6 @@ class GridGallery_Featuredplugins_Controller extends GridGallery_Core_BaseContro
35
  array('label' => $environment->translate('Digital Publication Plugin'), 'url' => $pluginsUrl. 'digital-publication-plugin/', 'img' => $uploadsUrl. 'Digital_Publication_256.png', 'desc' => $environment->translate('Digital Publication WordPress Plugin by Supsystic for Magazines, Catalogs, Portfolios. Convert images, posts, PDF to the page flip book.'), 'download' => $downloadsUrl. 'digital-publications-by-supsystic.zip'),
36
  array('label' => $environment->translate('Contact Form Plugin'), 'url' => $pluginsUrl. 'contact-form-plugin/', 'img' => $uploadsUrl. 'Contact_Form_256.png', 'desc' => $environment->translate('One of the best plugin for creating Contact Forms on your WordPress site. Changeable fonts, backgrounds, an option for adding fields etc.'), 'download' => $downloadsUrl. 'contact-form-by-supsystic.zip'),
37
  array('label' => $environment->translate('Newsletter Plugin'), 'url' => $pluginsUrl. 'newsletter-plugin/', 'img' => $uploadsUrl. 'icon-256x256.png', 'desc' => $environment->translate('Supsystic Newsletter plugin for automatic mailing of your letters. You will have no need to control it or send them manually. No coding, hard skills or long hours of customizing are required.'), 'download' => $downloadsUrl. 'newsletter-by-supsystic.zip'),
38
- array('label' => $environment->translate('Membership by Supsystic'), 'url' => $pluginsUrl. 'membership-plugin/', 'img' => $uploadsUrl. '256.png', 'desc' => $environment->translate('Create online membership community with custom user profiles, roles, FrontEnd registration and login. Members Directory, activity, groups, messages.'), 'download' => $downloadsUrl. 'membership-by-supsystic.zip'),
39
  array('label' => $environment->translate('Kinsta Hosting'), 'url' => 'https://kinsta.com?kaid=MNRQQASUYJRT', 'external' => true, 'img' => $this->getEnvironment()->getModule('core')->getPluginDirectoryUrl('app/assets/img/kinsta_banner.png'), 'desc' => $environment->translate('If you want to host a business site or a blog, Kinsta managed WordPress hosting is the best place to stop on. Without any hesitation, we can say Kinsta is incredible when it comes to uptime and speed.')),
40
  );
41
  foreach($pluginsList as $i => $p) {
35
  array('label' => $environment->translate('Digital Publication Plugin'), 'url' => $pluginsUrl. 'digital-publication-plugin/', 'img' => $uploadsUrl. 'Digital_Publication_256.png', 'desc' => $environment->translate('Digital Publication WordPress Plugin by Supsystic for Magazines, Catalogs, Portfolios. Convert images, posts, PDF to the page flip book.'), 'download' => $downloadsUrl. 'digital-publications-by-supsystic.zip'),
36
  array('label' => $environment->translate('Contact Form Plugin'), 'url' => $pluginsUrl. 'contact-form-plugin/', 'img' => $uploadsUrl. 'Contact_Form_256.png', 'desc' => $environment->translate('One of the best plugin for creating Contact Forms on your WordPress site. Changeable fonts, backgrounds, an option for adding fields etc.'), 'download' => $downloadsUrl. 'contact-form-by-supsystic.zip'),
37
  array('label' => $environment->translate('Newsletter Plugin'), 'url' => $pluginsUrl. 'newsletter-plugin/', 'img' => $uploadsUrl. 'icon-256x256.png', 'desc' => $environment->translate('Supsystic Newsletter plugin for automatic mailing of your letters. You will have no need to control it or send them manually. No coding, hard skills or long hours of customizing are required.'), 'download' => $downloadsUrl. 'newsletter-by-supsystic.zip'),
 
38
  array('label' => $environment->translate('Kinsta Hosting'), 'url' => 'https://kinsta.com?kaid=MNRQQASUYJRT', 'external' => true, 'img' => $this->getEnvironment()->getModule('core')->getPluginDirectoryUrl('app/assets/img/kinsta_banner.png'), 'desc' => $environment->translate('If you want to host a business site or a blog, Kinsta managed WordPress hosting is the best place to stop on. Without any hesitation, we can say Kinsta is incredible when it comes to uptime and speed.')),
39
  );
40
  foreach($pluginsList as $i => $p) {
src/GridGallery/Galleries/Controller.php CHANGED
@@ -24,7 +24,6 @@ class GridGallery_Galleries_Controller extends GridGallery_Core_BaseController
24
  'deleteGroupAction',
25
  'deleteResourceAction',
26
  'addImagesAction',
27
- 'saveSettingsAction',
28
  'saveCatsPresetAction',
29
  'savePagesPresetAction',
30
  'savePresetAction',
@@ -57,7 +56,6 @@ class GridGallery_Galleries_Controller extends GridGallery_Core_BaseController
57
  'cdn' => 'GridGallery_Optimization_Model_Cdn',
58
  'imageOptimize' => 'GridGallery_Optimization_Model_ImageOptimize',
59
  'optimization' => 'GridGallery_Optimization_Model_Optimization',
60
- 'membership' => 'GridGallery_Membership_Model_Membership',
61
  'pagination' => 'GridGallery_Galleries_Model_Pagination',
62
  );
63
  }
@@ -580,8 +578,9 @@ class GridGallery_Galleries_Controller extends GridGallery_Core_BaseController
580
  $this->getErrorResponseData($e->getMessage())
581
  );
582
  }
583
- $membershipModel = $this->getModel('membership');
584
- $membershipModel->removeRowByGalleryId((int)$request->query->get('gallery_id'));
 
585
  $cleanAllCache = false;
586
  $settings = $this->getModel('settings')->get($request->query->get('gallery_id'));
587
  if($settings && property_exists($settings, 'data')) {
@@ -735,13 +734,17 @@ class GridGallery_Galleries_Controller extends GridGallery_Core_BaseController
735
  $fontList = array_merge($this->getModel('settings')->getFontsList(), $uiModule->getStandardFontsList());
736
  sort($fontList);
737
 
738
- $membershipModel = $this->getModel('membership');
739
- $pageOptions = array(
740
- 'isSettingPage' => 1,
741
- 'isMembershipPluginActive' => $membershipModel->isPluginActive(),
742
- 'membershipInstallWpUrl' => $membershipModel->getPluginInstallWpUrl(),
743
- 'membershipInstallUrl' => $membershipModel->getPluginInstallUrl(),
744
- );
 
 
 
 
745
 
746
  if($request->query['clone_type'] != null && $request->query['oldGalleryId'] != null) {
747
  $cloneType = $request->query['clone_type'];
@@ -852,11 +855,11 @@ class GridGallery_Galleries_Controller extends GridGallery_Core_BaseController
852
 
853
  // update membership parameter
854
  $settingsParamsArr = $settings->get($galleryId);
855
- $membershipModel = $this->getModel('membership');
856
- if($membershipModel->isPluginActive()) {
857
- $membershipModel->updateRow(array('gallery_id' => $galleryId, 'allow_use' => isset($settingsParamsArr->data['plugins']['membership']['enable']) ? $settingsParamsArr->data['plugins']['membership']['enable'] : 0));
858
- }
859
-
860
  return $this->redirect(
861
  $this->generateUrl(
862
  'galleries',
@@ -866,6 +869,7 @@ class GridGallery_Galleries_Controller extends GridGallery_Core_BaseController
866
  )
867
  )
868
  );
 
869
  }
870
 
871
  /**
@@ -1466,7 +1470,7 @@ class GridGallery_Galleries_Controller extends GridGallery_Core_BaseController
1466
  'resources' => $this->getModel('resources'),
1467
  'settings' => $this->getModel('settings'),
1468
  'position' => $this->getModel('position'),
1469
- 'membership' => $this->getModel('membership'),
1470
  'cdn' => $this->getModel('cdn'),
1471
  );
1472
  }
24
  'deleteGroupAction',
25
  'deleteResourceAction',
26
  'addImagesAction',
 
27
  'saveCatsPresetAction',
28
  'savePagesPresetAction',
29
  'savePresetAction',
56
  'cdn' => 'GridGallery_Optimization_Model_Cdn',
57
  'imageOptimize' => 'GridGallery_Optimization_Model_ImageOptimize',
58
  'optimization' => 'GridGallery_Optimization_Model_Optimization',
 
59
  'pagination' => 'GridGallery_Galleries_Model_Pagination',
60
  );
61
  }
578
  $this->getErrorResponseData($e->getMessage())
579
  );
580
  }
581
+ $membershipModel = false;
582
+ // $membershipModel = $this->getModel('membership');
583
+ // $membershipModel->removeRowByGalleryId((int)$request->query->get('gallery_id'));
584
  $cleanAllCache = false;
585
  $settings = $this->getModel('settings')->get($request->query->get('gallery_id'));
586
  if($settings && property_exists($settings, 'data')) {
734
  $fontList = array_merge($this->getModel('settings')->getFontsList(), $uiModule->getStandardFontsList());
735
  sort($fontList);
736
 
737
+ // $membershipModel = $this->getModel('membership');
738
+ // $pageOptions = array(
739
+ // 'isSettingPage' => 1,
740
+ // 'isMembershipPluginActive' => $membershipModel->isPluginActive(),
741
+ // 'membershipInstallWpUrl' => $membershipModel->getPluginInstallWpUrl(),
742
+ // 'membershipInstallUrl' => $membershipModel->getPluginInstallUrl(),
743
+ // );
744
+
745
+ $pageOptions = array();
746
+
747
+ $membershipModel = false;
748
 
749
  if($request->query['clone_type'] != null && $request->query['oldGalleryId'] != null) {
750
  $cloneType = $request->query['clone_type'];
855
 
856
  // update membership parameter
857
  $settingsParamsArr = $settings->get($galleryId);
858
+ // $membershipModel = $this->getModel('membership');
859
+ // if($membershipModel->isPluginActive()) {
860
+ // $membershipModel->updateRow(array('gallery_id' => $galleryId, 'allow_use' => isset($settingsParamsArr->data['plugins']['membership']['enable']) ? $settingsParamsArr->data['plugins']['membership']['enable'] : 0));
861
+ // }
862
+ //
863
  return $this->redirect(
864
  $this->generateUrl(
865
  'galleries',
869
  )
870
  )
871
  );
872
+ $membershipModel = false;
873
  }
874
 
875
  /**
1470
  'resources' => $this->getModel('resources'),
1471
  'settings' => $this->getModel('settings'),
1472
  'position' => $this->getModel('position'),
1473
+ // 'membership' => $this->getModel('membership'),
1474
  'cdn' => $this->getModel('cdn'),
1475
  );
1476
  }
src/GridGallery/Galleries/Model/Galleries.php CHANGED
@@ -1024,12 +1024,12 @@ class GridGallery_Galleries_Model_Galleries extends GridGallery_Core_BaseModel
1024
  $gallery->settings = $settings->data;
1025
  }
1026
 
1027
- if(isset($attributes) && isset($attributes['membershipModel'])) {
1028
- $memberShipModel = $attributes['membershipModel'];
1029
- foreach($attributes['image-list'] as $oneImage) {
1030
- $gallery->photos[] = $memberShipModel->getGalleryAttachmenEmuledImage($oneImage);
1031
- }
1032
- } else {
1033
  $resources = new GridGallery_Galleries_Model_Resources($this->debugEnabled);
1034
  $resourcesData = $resources->getByGalleryId($gallery->id);
1035
 
@@ -1060,7 +1060,7 @@ class GridGallery_Galleries_Model_Galleries extends GridGallery_Core_BaseModel
1060
  }
1061
  }*/
1062
  $gallery->photos = $models['photos']->getPhotos($resourcesData);
1063
- }
1064
 
1065
  return $gallery;
1066
  }
@@ -1107,7 +1107,7 @@ class GridGallery_Galleries_Model_Galleries extends GridGallery_Core_BaseModel
1107
  $settingsModel = $parameters['settings'];
1108
  $positionModel = $parameters['position'];
1109
  $cdnModel = $parameters['cdn'];
1110
- $membershipModel = $parameters['membership'];
1111
 
1112
  $hasError = false;
1113
  $message = '';
@@ -1156,10 +1156,10 @@ class GridGallery_Galleries_Model_Galleries extends GridGallery_Core_BaseModel
1156
  $hasError = true;
1157
  }
1158
  // gg_membership_presets
1159
- if(!$hasError && !$membershipModel->cloneByGalleryId($galleryId, $newGalleryId)) {
1160
- $message = $language->translate('Can\'t create membership params for gallery!');
1161
- $hasError = true;
1162
- }
1163
  }
1164
 
1165
  return array(
1024
  $gallery->settings = $settings->data;
1025
  }
1026
 
1027
+ // if(isset($attributes) && isset($attributes['membershipModel'])) {
1028
+ // $memberShipModel = $attributes['membershipModel'];
1029
+ // foreach($attributes['image-list'] as $oneImage) {
1030
+ // $gallery->photos[] = $memberShipModel->getGalleryAttachmenEmuledImage($oneImage);
1031
+ // }
1032
+ // } else {
1033
  $resources = new GridGallery_Galleries_Model_Resources($this->debugEnabled);
1034
  $resourcesData = $resources->getByGalleryId($gallery->id);
1035
 
1060
  }
1061
  }*/
1062
  $gallery->photos = $models['photos']->getPhotos($resourcesData);
1063
+ // }
1064
 
1065
  return $gallery;
1066
  }
1107
  $settingsModel = $parameters['settings'];
1108
  $positionModel = $parameters['position'];
1109
  $cdnModel = $parameters['cdn'];
1110
+ // $membershipModel = $parameters['membership'];
1111
 
1112
  $hasError = false;
1113
  $message = '';
1156
  $hasError = true;
1157
  }
1158
  // gg_membership_presets
1159
+ // if(!$hasError && !$membershipModel->cloneByGalleryId($galleryId, $newGalleryId)) {
1160
+ // $message = $language->translate('Can\'t create membership params for gallery!');
1161
+ // $hasError = true;
1162
+ // }
1163
  }
1164
 
1165
  return array(
src/GridGallery/Galleries/Model/Pagination.php CHANGED
@@ -8,7 +8,7 @@ class GridGallery_Galleries_Model_Pagination extends GridGallery_Core_BaseModel
8
 
9
  public $pageParam = 'gp';
10
  public $pageSizeParam = 'gpp';
11
-
12
  public $totalCount = 0;
13
  public $defaultPageSize = 100;
14
 
@@ -99,7 +99,7 @@ class GridGallery_Galleries_Model_Pagination extends GridGallery_Core_BaseModel
99
  } else {
100
  unset($params[$this->pageSizeParam]);
101
  }
102
- $currentUrl = strtok($_SERVER["REQUEST_URI"], '?');
103
  $httpParams = http_build_query($params);
104
  if(strlen($httpParams)) {
105
  $httpParams = '?' . $httpParams;
@@ -137,7 +137,7 @@ class GridGallery_Galleries_Model_Pagination extends GridGallery_Core_BaseModel
137
  }
138
 
139
  protected function getAllParams() {
140
- return $_REQUEST;
141
  }
142
 
143
  protected function getQueryParam($name, $defaultValue = null) {
@@ -190,11 +190,11 @@ class GridGallery_Galleries_Model_Pagination extends GridGallery_Core_BaseModel
190
  $resLinks['info']['next'] = $links['next'];
191
  $resLinks['info']['last'] = $links['last'];
192
  }
193
-
194
  // prepare per page list
195
  $resLinks['info']['perPageArr'] = $this->getPerPageSelectorList();
196
  // current selected value
197
- $resLinks['info']['perPage'] = $this->getPerPageParam();
198
 
199
  return $resLinks;
200
  }
@@ -216,11 +216,11 @@ class GridGallery_Galleries_Model_Pagination extends GridGallery_Core_BaseModel
216
  // default value
217
  $perPage = $this->defaultPageSize;
218
  if(isset($_REQUEST['gpp'])) {
219
- $tempPerPage = $_REQUEST['gpp'];
220
  if(in_array($tempPerPage, array_keys($selectorList))) {
221
  $perPage = $tempPerPage;
222
  }
223
  }
224
  return $perPage;
225
  }
226
- }
8
 
9
  public $pageParam = 'gp';
10
  public $pageSizeParam = 'gpp';
11
+
12
  public $totalCount = 0;
13
  public $defaultPageSize = 100;
14
 
99
  } else {
100
  unset($params[$this->pageSizeParam]);
101
  }
102
+ $currentUrl = strtok(sanitize_text_field($_SERVER["REQUEST_URI"]), '?');
103
  $httpParams = http_build_query($params);
104
  if(strlen($httpParams)) {
105
  $httpParams = '?' . $httpParams;
137
  }
138
 
139
  protected function getAllParams() {
140
+ return array();
141
  }
142
 
143
  protected function getQueryParam($name, $defaultValue = null) {
190
  $resLinks['info']['next'] = $links['next'];
191
  $resLinks['info']['last'] = $links['last'];
192
  }
193
+
194
  // prepare per page list
195
  $resLinks['info']['perPageArr'] = $this->getPerPageSelectorList();
196
  // current selected value
197
+ $resLinks['info']['perPage'] = $this->getPerPageParam();
198
 
199
  return $resLinks;
200
  }
216
  // default value
217
  $perPage = $this->defaultPageSize;
218
  if(isset($_REQUEST['gpp'])) {
219
+ $tempPerPage = sanitize_text_field($_REQUEST['gpp']);
220
  if(in_array($tempPerPage, array_keys($selectorList))) {
221
  $perPage = $tempPerPage;
222
  }
223
  }
224
  return $perPage;
225
  }
226
+ }
src/GridGallery/Galleries/Model/plugins/Mobile_Detect.php CHANGED
@@ -664,7 +664,7 @@ class Mobile_Detect
664
  {
665
  // use global _SERVER if $httpHeaders aren't defined
666
  if (!is_array($httpHeaders) || !count($httpHeaders)) {
667
- $httpHeaders = $_SERVER;
668
  }
669
 
670
  // clear existing headers
664
  {
665
  // use global _SERVER if $httpHeaders aren't defined
666
  if (!is_array($httpHeaders) || !count($httpHeaders)) {
667
+ $httpHeaders = array();
668
  }
669
 
670
  // clear existing headers
src/GridGallery/Galleries/Module.php CHANGED
@@ -296,12 +296,12 @@ class GridGallery_Galleries_Module extends GridGallery_Core_Module
296
  $id = $attributes['id'];
297
  $cachePath = $this->getCache($id);
298
  $settingsModel = $this->getModel('settings');
299
- $membershipModel = $this->getModel('membership');
300
 
301
- if($membershipModel->isPluginActive() && isset($attributes['image-list']) && count($attributes['image-list'])) {
302
- $cachePath .= '-' . md5(json_encode($attributes['image-list']));
303
- $attributes['membershipModel'] = $this->getModel('membership');
304
- }
305
  $this->initSocialSharePlugin($id);
306
 
307
  global $wpdb;
@@ -429,7 +429,7 @@ class GridGallery_Galleries_Module extends GridGallery_Core_Module
429
  $settings->data['area']['distance'] = $settings->data['area']['distance'] + 0.3;
430
  }
431
 
432
- if (!isset($attributes['membershipModel']) && property_exists($gallery, 'photos') && is_array($gallery->photos)) {
433
  $position = new GridGallery_Photos_Model_Position();
434
 
435
  /*foreach ($gallery->photos as $index => $row) {
296
  $id = $attributes['id'];
297
  $cachePath = $this->getCache($id);
298
  $settingsModel = $this->getModel('settings');
299
+ // $membershipModel = $this->getModel('membership');
300
 
301
+ // if($membershipModel->isPluginActive() && isset($attributes['image-list']) && count($attributes['image-list'])) {
302
+ // $cachePath .= '-' . md5(json_encode($attributes['image-list']));
303
+ // $attributes['membershipModel'] = $this->getModel('membership');
304
+ // }
305
  $this->initSocialSharePlugin($id);
306
 
307
  global $wpdb;
429
  $settings->data['area']['distance'] = $settings->data['area']['distance'] + 0.3;
430
  }
431
 
432
+ if (property_exists($gallery, 'photos') && is_array($gallery->photos)) {
433
  $position = new GridGallery_Photos_Model_Position();
434
 
435
  /*foreach ($gallery->photos as $index => $row) {
src/GridGallery/Galleries/views/settings.twig CHANGED
@@ -253,34 +253,6 @@
253
  {{ translate('Clone') }}
254
  </a>
255
  </div>
256
- <div class="gg-sett-preview-other-plugin">
257
- <label for="enableForMembership" class="gg-sett-plugin-member-lbl">{{ translate('Enable for Membership:') }}</label>
258
- {% if pageOptions.isMembershipPluginActive == 'true' %}
259
- <select id="enableForMembership" style="width: auto;" name="plugins[membership][enable]" {{ disableMembershipOpt }} >
260
- <option value="0" {% if settings.plugins.membership.enable == '0' %}selected="selected"{% endif %}>
261
- {{ translate('No') }}
262
- </option>
263
- <option value="1" {% if settings.plugins.membership.enable == '1' %}selected="selected"{% endif %}>
264
- {{ translate('Yes') }}
265
- </option>
266
- </select>
267
- {% else %}
268
- <select id="enableForMembershipFake" style="width: auto;" name="membership_feick" >
269
- <option value="0" selected="selected">
270
- {{ translate('No') }}
271
- </option>
272
- <option value="1">
273
- {{ translate('Yes') }}
274
- </option>
275
- </select>
276
- <div class="gg-membership-plug-info" style="display: none;">
277
- {{ translate('You need to install Membership by Supsystic to use this feature. ') }}
278
- <a target="_blank" href="{{ pageOptions.membershipInstallUrl }}">Install</a>
279
- {{ translate(' plugin from your admin area, or visit it\'s official page on Wordpress.org ') }}
280
- <a target="_blank" href="{{ pageOptions.membershipInstallWpUrl }}">here</a>
281
- </div>
282
- {% endif %}
283
- </div>
284
  </div>
285
  <input type="hidden" id="ggMsgCloningGallery" value="{{ translate('Cloning gallery...') }}"/>
286
  <input type="hidden" id="ggMsgServerInternalError" value="{{ translate('Server internal error') }}"/>
253
  {{ translate('Clone') }}
254
  </a>
255
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  </div>
257
  <input type="hidden" id="ggMsgCloningGallery" value="{{ translate('Cloning gallery...') }}"/>
258
  <input type="hidden" id="ggMsgServerInternalError" value="{{ translate('Server internal error') }}"/>
src/GridGallery/Membership/Model/Membership.php DELETED
@@ -1,169 +0,0 @@
1
- <?php
2
- class GridGallery_Membership_Model_Membership extends Rsc_Mvc_Model {
3
-
4
- protected $table;
5
- protected $memberShipClassName;
6
-
7
- public function __construct() {
8
- parent::__construct();
9
- $this->table = $this->db->prefix . 'gg_membership_presets';
10
- $this->memberShipClassName = 'SupsysticMembership';
11
- }
12
-
13
- public function isPluginActive() {
14
- $tableExistsQuery = "SHOW TABLES LIKE '" . $this->table . "'";
15
- $results = $this->db->get_results($tableExistsQuery);
16
-
17
- if(count($results) && class_exists($this->memberShipClassName)) {
18
- return true;
19
- }
20
- return false;
21
- }
22
-
23
- public function getPluginInstallUrl() {
24
- return add_query_arg(
25
- array(
26
- 's' => 'Membership by Supsystic',
27
- 'tab' => 'search',
28
- 'type' => 'term',
29
- ),
30
- admin_url( 'plugin-install.php' )
31
- );
32
- }
33
-
34
- public function getPluginInstallWpUrl() {
35
- return 'https://wordpress.org/plugins/membership-by-supsystic/';
36
- }
37
-
38
- public function updateRow($params) {
39
- if(isset($params['gallery_id']) && isset($params['allow_use'])) {
40
- $allowUse = (int)$params['allow_use'];
41
- $galleryId = (int)$params['gallery_id'];
42
-
43
- $query = "INSERT INTO `" . $this->table . "`(`gallery_id`, `allow_use`)"
44
- . " VALUES (" . $galleryId . ", " . $allowUse . ") "
45
- . "ON DUPLICATE KEY UPDATE `allow_use`=" . $allowUse;
46
-
47
- $res = $this->db->query($query);
48
- return $res;
49
- }
50
- return false;
51
- }
52
-
53
- public function removeRowByGalleryId($galleryId) {
54
- $query = "DELETE FROM " . $this->table
55
- . " WHERE `gallery_id`=" . (int) $galleryId;
56
-
57
- $res = $this->db->query($query);
58
- return $res;
59
- }
60
-
61
- /**
62
- * prepare photo images from simple image file to gallery attachment (not all gallery functions supporting)
63
- * @param array $simpleImage
64
- */
65
- public function getGalleryAttachmenEmuledImage(array $simpleImage) {
66
-
67
- $attachment = array(
68
- 'id' => null,
69
- 'title' => '',
70
- 'filename' => '',
71
- 'url' => $simpleImage['url'],
72
- 'link' => '',
73
- 'alt' => '',
74
- 'author' => 0,
75
- 'description' => '',
76
- 'caption' => '',
77
- 'name' => '',
78
- 'status' => 'inherit',
79
- 'uploadedTo' => 0,
80
- 'date' => 0,
81
- 'modified' => 0,
82
- 'menuOrder' => 0,
83
- 'mime' => 'image/jpeg',
84
- 'type' => 'image',
85
- 'subtype' => 'jpeg',
86
- 'icon' => '',
87
- 'dateFormatted' => '',
88
- 'nonces' => array (),
89
- 'editLink' => '',
90
- 'meta' => null,
91
- 'authorName' => '',
92
- 'filesizeInBytes' => 0,
93
- 'filesizeHumanReadable' => '0 KB',
94
- 'height' => $simpleImage['height'],
95
- 'width' => $simpleImage['width'],
96
- 'orientation' => 'landscape',
97
- 'sizes' => array(
98
- 'thumbnail' => array(
99
- 'height' => $simpleImage['height'],
100
- 'width' => $simpleImage['width'],
101
- 'url' => $simpleImage['url'], //http://sst-w1.loc/wp-content/uploads/2016/11/roses7-1024x640.jpg
102
- 'orientation' => 'landscape',
103
- ),
104
- 'medium' => array(
105
- 'url' => $simpleImage['url'],
106
- 'height' => $simpleImage['height'],
107
- 'width' => $simpleImage['width'],
108
- 'orientation' => 'landscape',
109
- ),
110
- 'large' => array(
111
- 'url' => $simpleImage['url'],
112
- 'height' => $simpleImage['height'],
113
- 'width' => $simpleImage['width'],
114
- 'orientation' => 'landscape',
115
- ),
116
- 'full' => array(
117
- 'url' => $simpleImage['url'],
118
- 'height' => $simpleImage['height'],
119
- 'width' => $simpleImage['width'],
120
- 'orientation' => 'landscape',
121
- ),
122
- ),
123
- 'external_link' => null,
124
- 'target' => '_self',
125
- 'video' => null,
126
- 'linkedImages' => '',
127
- 'hoverCaptionImage' => null,
128
- 'rel' => null,
129
- 'captionEffect' => '',
130
- 'cropPosition' => 'center-center',
131
- 'isNotRealAttachment' => 1,
132
- );
133
-
134
- $attachmentImageEmulator = new stdClass();
135
- $attachmentImageEmulator->id = null;
136
- $attachmentImageEmulator->folder_id = 0;
137
- $attachmentImageEmulator->album_id = 0;
138
- $attachmentImageEmulator->attachment_id = null;
139
- $attachmentImageEmulator->position = 9000;
140
- $attachmentImageEmulator->timestamp = null;
141
- $attachmentImageEmulator->attachment = $attachment;
142
- $attachmentImageEmulator->is_used = 1;
143
- $attachmentImageEmulator->used_times = 1;
144
- $attachmentImageEmulator->tags = array();
145
-
146
- return $attachmentImageEmulator;
147
- }
148
-
149
- public function getByGalleryId($galleryId) {
150
- $query = $this->getQueryBuilder()->select('allow_use')
151
- ->from($this->table)
152
- ->where('gallery_id', '=', (int) $galleryId);
153
- $res = $this->db->get_results($query->build(), ARRAY_A);
154
- return $res;
155
- }
156
-
157
- public function cloneByGalleryId($galleryId, $newGalleryId) {
158
- $membershipItems = $this->getByGalleryId($galleryId);
159
- if(count($membershipItems)) {
160
- foreach($membershipItems as $memberValue) {
161
- $this->updateRow(array(
162
- 'gallery_id' => $newGalleryId,
163
- 'allow_use' => $memberValue['allow_use'],
164
- ));
165
- }
166
- }
167
- return true;
168
- }
169
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/GridGallery/Optimization/Controller.php CHANGED
@@ -542,9 +542,9 @@ class GridGallery_Optimization_Controller extends GridGallery_Core_BaseControlle
542
 
543
  private function transferToCdnOnePhotoObj($ftpModel, $attachModel, $onePhoto, $needToDelete) {
544
  if(isset($_SERVER['HTTP_X_REQUEST_SCHEME'])) {
545
- $currServerName = $_SERVER['HTTP_X_REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'];
546
  } else {
547
- $currServerName = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'];
548
  }
549
  $ftpMainImgUrl = preg_replace('`' . $currServerName . '`', '', $onePhoto['img_url']);
550
  $mainPath = realpath($attachModel->replaceUrlToFilePath($onePhoto['img_url']));
@@ -556,4 +556,4 @@ class GridGallery_Optimization_Controller extends GridGallery_Core_BaseControlle
556
  $ftpModel->uploadFileOnServer($ftpPreviewImgUrl, $previewPath);
557
  }
558
  }
559
- }
542
 
543
  private function transferToCdnOnePhotoObj($ftpModel, $attachModel, $onePhoto, $needToDelete) {
544
  if(isset($_SERVER['HTTP_X_REQUEST_SCHEME'])) {
545
+ $currServerName = sanitize_text_field($_SERVER['HTTP_X_REQUEST_SCHEME']) . '://' . sanitize_text_field($_SERVER['HTTP_HOST']);
546
  } else {
547
+ $currServerName = sanitize_text_field($_SERVER['REQUEST_SCHEME']) . '://' . sanitize_text_field($_SERVER['HTTP_HOST']);
548
  }
549
  $ftpMainImgUrl = preg_replace('`' . $currServerName . '`', '', $onePhoto['img_url']);
550
  $mainPath = realpath($attachModel->replaceUrlToFilePath($onePhoto['img_url']));
556
  $ftpModel->uploadFileOnServer($ftpPreviewImgUrl, $previewPath);
557
  }
558
  }
559
+ }
src/GridGallery/Optimization/Model/Cdn.php CHANGED
@@ -25,7 +25,7 @@ class GridGallery_Optimization_Model_Cdn extends Rsc_Mvc_Model {
25
  }
26
 
27
  public function getCurrentServerName() {
28
- return $_SERVER['HTTP_HOST'];
29
  }
30
 
31
  public function getServiceSettings() {
@@ -147,4 +147,4 @@ class GridGallery_Optimization_Model_Cdn extends Rsc_Mvc_Model {
147
  }
148
  return null;
149
  }
150
- }
25
  }
26
 
27
  public function getCurrentServerName() {
28
+ return sanitize_text_field($_SERVER['HTTP_HOST']);
29
  }
30
 
31
  public function getServiceSettings() {
147
  }
148
  return null;
149
  }
150
+ }
src/GridGallery/Overview/Controller.php CHANGED
@@ -88,7 +88,7 @@ class GridGallery_Overview_Controller extends GridGallery_Core_BaseController
88
  return array(
89
  'Operating System' => array('value' => PHP_OS),
90
  'PHP Version' => array('value' => PHP_VERSION),
91
- 'Server Software' => array('value' => $_SERVER['SERVER_SOFTWARE']),
92
  'MySQL version' => array('value' => $wpdb->db_version()),
93
  'MySQLi driver' => array('value' => $wpdb->use_mysqli ? 'Yes' : 'No'),
94
  'PHP Allow URL Fopen' => array('value' => ini_get('allow_url_fopen') ? 'Yes' : 'No'),
@@ -109,7 +109,7 @@ class GridGallery_Overview_Controller extends GridGallery_Core_BaseController
109
  protected function getMailErrors()
110
  {
111
  global $ts_mail_errors;
112
-
113
  if (!isset($ts_mail_errors)) {
114
  $ts_mail_errors = array();
115
  }
88
  return array(
89
  'Operating System' => array('value' => PHP_OS),
90
  'PHP Version' => array('value' => PHP_VERSION),
91
+ 'Server Software' => array('value' => sanitize_text_field($_SERVER['SERVER_SOFTWARE'])),
92
  'MySQL version' => array('value' => $wpdb->db_version()),
93
  'MySQLi driver' => array('value' => $wpdb->use_mysqli ? 'Yes' : 'No'),
94
  'PHP Allow URL Fopen' => array('value' => ini_get('allow_url_fopen') ? 'Yes' : 'No'),
109
  protected function getMailErrors()
110
  {
111
  global $ts_mail_errors;
112
+
113
  if (!isset($ts_mail_errors)) {
114
  $ts_mail_errors = array();
115
  }
src/GridGallery/Settings/Controller.php CHANGED
@@ -50,9 +50,6 @@ class GridGallery_Settings_Controller extends GridGallery_Core_BaseController
50
  }
51
 
52
  public function saveSettingsAction(Rsc_Http_Request $request) {
53
-
54
-
55
-
56
  $optionsName = $this->getConfig()->get('db_prefix') . 'settings';
57
  $currentSettings = get_option($optionsName);
58
  $settings = $request->post->get('settings', array());
50
  }
51
 
52
  public function saveSettingsAction(Rsc_Http_Request $request) {
 
 
 
53
  $optionsName = $this->getConfig()->get('db_prefix') . 'settings';
54
  $currentSettings = get_option($optionsName);
55
  $settings = $request->post->get('settings', array());
src/GridGallery/Ui/Module.php CHANGED
@@ -77,7 +77,7 @@ class GridGallery_Ui_Module extends Rsc_Mvc_Module
77
  wp_localize_script('sg-ajax.js', 'sggStandartFontsList', $this->getStandardFontsList());
78
  if($this->getEnvironment()->isPro()) {
79
  if(version_compare($this->getEnvironment()->getConfig()->get('pro_plugin_version'), '2.7.6', '<')) {
80
- wp_enqueue_script('webfont-js', SG_PLUGIN_URL . '/app/assets/js/webfont.js',);
81
  }
82
  }
83
  }
77
  wp_localize_script('sg-ajax.js', 'sggStandartFontsList', $this->getStandardFontsList());
78
  if($this->getEnvironment()->isPro()) {
79
  if(version_compare($this->getEnvironment()->getConfig()->get('pro_plugin_version'), '2.7.6', '<')) {
80
+ wp_enqueue_script('webfont-js', SG_PLUGIN_URL . '/app/assets/js/webfont.js');
81
  }
82
  }
83
  }
vendor/Rsc/Resolver.php CHANGED
@@ -111,7 +111,7 @@ class Rsc_Resolver
111
  if ($name === 'installer') {
112
  register_uninstall_hook($index, array(get_class($instance), 'onUninstall'));
113
  }
114
-
115
  /* We add module's location to the template & config loaders */
116
 
117
  /** @var Twig_SupTwg_Loader_Filesystem $loader */
111
  if ($name === 'installer') {
112
  register_uninstall_hook($index, array(get_class($instance), 'onUninstall'));
113
  }
114
+
115
  /* We add module's location to the template & config loaders */
116
 
117
  /** @var Twig_SupTwg_Loader_Filesystem $loader */