Photo Gallery by WD – Responsive Photo Gallery - Version 1.5.55

Version Description

  • Fixed: Security issue.
  • Fixed: Minor bug.
Download this release

Release Info

Developer 10web
Plugin Icon 128x128 Photo Gallery by WD – Responsive Photo Gallery
Version 1.5.55
Comparing to
See all releases

Code changes from version 1.5.53 to 1.5.55

framework/BWGOptions.php CHANGED
@@ -349,7 +349,8 @@ class WD_BWG_Options {
349
  }
350
  else {
351
  // For old users, who have changed images directory.
352
- $this->upload_dir = BWG()->abspath . '/' . $this->images_directory . '/photo-gallery';
 
353
  $this->upload_url = site_url() . '/' . $this->images_directory . '/photo-gallery';
354
  }
355
 
349
  }
350
  else {
351
  // For old users, who have changed images directory.
352
+ // Using ABSPATH here instead of BWG()->abspath to avoid memory leak.
353
+ $this->upload_dir = BWG::get_abspath() . '/' . $this->images_directory . '/photo-gallery';
354
  $this->upload_url = site_url() . '/' . $this->images_directory . '/photo-gallery';
355
  }
356
 
frontend/models/model.php CHANGED
@@ -196,40 +196,40 @@ class BWGModelSite {
196
  }
197
 
198
  public function get_alb_gals_row( $bwg, $id, $albums_per_page, $sort_by, $order_by, $pagination_type = 0, $from = '' ) {
199
- if ( $albums_per_page < 0 ) {
200
  $albums_per_page = 0;
201
  }
202
  global $wpdb;
203
- $order_by = 'ORDER BY `' . ( (!empty($from) && $from === 'widget') ? 'id' : $sort_by ) . '` ' . $order_by;
204
- if( $sort_by == 'random' || $sort_by == 'RAND()' ) {
205
- $order_by = 'ORDER BY RAND()';
206
- }
207
- $search_where = '';
208
- $search_value = trim( WDWLibrary::get('bwg_search_' . $bwg) );
209
- if ( !empty($search_value) ) {
210
- $search_keys = explode(' ', $search_value);
211
  $alt_search = '(';
212
  $description_search = '(';
213
- foreach( $search_keys as $search_key) {
214
- $alt_search .= '`{{table}}`.`name` LIKE "%' . trim($search_key) . '%" AND ';
215
- $description_search .= '`{{table}}`.`description` LIKE "%' . trim($search_key) . '%" AND ';
216
  }
217
- $alt_search = rtrim($alt_search, 'AND ');
218
  $alt_search .= ')';
219
- $description_search = rtrim($description_search, 'AND ');
220
  $description_search .= ')';
221
  $search_where = ' AND (' . $alt_search . ' OR ' . $description_search . ')';
222
  }
223
- $limit = 0;
224
- $page_number = WDWLibrary::get('page_number_' . $bwg, 0, 'intval');
225
  if ( $page_number ) {
226
- $limit = ( (int) $page_number - 1) * $albums_per_page;
227
  }
228
  $limit_str = '';
229
  if ( $albums_per_page ) {
230
  $limit_str = 'LIMIT ' . $limit . ',' . $albums_per_page;
231
  }
232
- if ( WDWLibrary::get('action_' . $bwg) == 'back' && ($pagination_type == 2 || $pagination_type == 3) ) {
233
  if ( $page_number ) {
234
  if ( $albums_per_page ) {
235
  $limit = $albums_per_page * $page_number;
@@ -239,53 +239,53 @@ class BWGModelSite {
239
  }
240
  // Select all galleries.
241
  if ( $id == 0 ) {
242
- $query = 'SELECT * FROM `' . $wpdb->prefix . 'bwg_gallery` WHERE `published`=1' . str_replace('{{table}}', $wpdb->prefix . 'bwg_gallery', $search_where);
243
  $limitation = ' ' . $order_by . ' ' . $limit_str;
244
  $sql = $query . $limitation;
245
- $rows = $wpdb->get_results( $sql );
246
- $total = $wpdb->get_var('SELECT count(*) FROM `' . $wpdb->prefix . 'bwg_gallery` WHERE `published`=1' . str_replace('{{table}}', $wpdb->prefix . 'bwg_gallery', $search_where) );
247
  }
248
  else {
249
- $query = '( SELECT t.*, t1.preview_image, t1.random_preview_image, t1.name, t1.description, t1.slug, t1.modified_date FROM `' . $wpdb->prefix . 'bwg_album_gallery` as t';
250
  $query .= ' LEFT JOIN `' . $wpdb->prefix . 'bwg_album` as t1 ON (t.is_album=1 AND t.alb_gal_id = t1.id)';
251
  $query .= ' WHERE t.album_id="' . $id . '"';
252
- $query .= ' AND t1.published=1' . str_replace('{{table}}', 't1', $search_where);
253
- $query .= ') ';
254
- $query .= ' UNION ';
255
- $query .= '( SELECT t.*, t2.preview_image, t2.random_preview_image, t2.name, t2.description, t2.slug, t2.modified_date FROM `' . $wpdb->prefix . 'bwg_album_gallery` as t';
256
  $query .= ' LEFT JOIN `' . $wpdb->prefix . 'bwg_gallery` as t2 ON (t.is_album=0 AND t.alb_gal_id = t2.id)';
257
  $query .= ' WHERE t.album_id="' . $id . '"';
258
- $query .= ' AND t2.published=1' . str_replace('{{table}}', 't2', $search_where);
259
  $query .= ')';
260
  $limitation = ' ' . $order_by . ' ' . $limit_str;
261
  $sql = $query . $limitation;
262
- $rows = $wpdb->get_results($sql);
263
- $total = count($wpdb->get_results($query));
264
  }
265
  if ( $rows ) {
266
  foreach ( $rows as $row ) {
267
- $row->def_type = isset($row->is_album) && $row->is_album ? 'album' : 'gallery';
268
  if ( $from ) {
269
- $row->permalink = WDWLibrary::get_custom_post_permalink(array( 'slug' => $row->slug, 'post_type' => $row->def_type ));
270
  }
271
  else {
272
  $row->permalink = '';
273
  }
274
 
275
- if ( !empty($row->preview_image) ) {
276
- $row->resolution_thumb = WDWLibrary::get_thumb_size($row->preview_image);
277
  if ( $row->resolution_thumb == "" ) {
278
- $row->resolution_thumb = $this->get_album_preview_thumb_dimensions($row->preview_image);
279
  }
280
 
281
- $row->preview_image = WDWLibrary::image_url_version($row->preview_image, $row->modified_date);
282
  }
283
- if ( !empty($row->random_preview_image) ) {
284
- $row->resolution_thumb = WDWLibrary::get_thumb_size($row->random_preview_image);
285
  if ( $row->resolution_thumb == "" ) {
286
- $row->resolution_thumb = $this->get_album_preview_thumb_dimensions($row->random_preview_image);
287
  }
288
- $row->random_preview_image = WDWLibrary::image_url_version($row->random_preview_image, $row->modified_date);
289
  }
290
  if ( !$row->preview_image ) {
291
  $row->preview_image = $row->random_preview_image;
@@ -296,7 +296,7 @@ class BWGModelSite {
296
  $row->preview_path = BWG()->plugin_dir . '/images/no-image.png';
297
  }
298
  else {
299
- $parsed_prev_url = parse_url($row->preview_image, PHP_URL_SCHEME);
300
  if ( $parsed_prev_url == 'http' || $parsed_prev_url == 'https' ) {
301
  $row->preview_path = $row->preview_image;
302
  $row->preview_image = $row->preview_image;
@@ -307,15 +307,15 @@ class BWGModelSite {
307
  }
308
  }
309
 
310
- $row->description = wpautop($row->description);
311
  }
312
  }
313
 
314
- $page_nav['limit'] = 1;
315
- $page_nav['total'] = $total;
316
- $page_number = WDWLibrary::get('page_number_' . $bwg, 0, 'intval');
317
  if ( $page_number ) {
318
- $page_nav[ 'limit' ] = (int) $page_number;
319
  }
320
 
321
  return array( 'rows' => $rows, 'page_nav' => $page_nav );
196
  }
197
 
198
  public function get_alb_gals_row( $bwg, $id, $albums_per_page, $sort_by, $order_by, $pagination_type = 0, $from = '' ) {
199
+ if ( $albums_per_page < 0 ) {
200
  $albums_per_page = 0;
201
  }
202
  global $wpdb;
203
+ $order_by = 'ORDER BY `' . ( ( !empty( $from ) && $from === 'widget' ) ? 'id' : $sort_by ) . '` ' . $order_by;
204
+ if ( $sort_by == 'random' || $sort_by == 'RAND()' ) {
205
+ $order_by = 'ORDER BY RAND()';
206
+ }
207
+ $search_where = '';
208
+ $search_value = trim( WDWLibrary::get( 'bwg_search_' . $bwg ) );
209
+ if ( !empty( $search_value ) ) {
210
+ $search_keys = explode( ' ', $search_value );
211
  $alt_search = '(';
212
  $description_search = '(';
213
+ foreach ( $search_keys as $search_key ) {
214
+ $alt_search .= $wpdb->prepare( '`{{table}}`.`name` LIKE "%s" AND ', '%' . trim( $search_key ) . '%' );
215
+ $description_search .= $wpdb->prepare( '`{{table}}`.`description` LIKE "%s" AND ', '%' . trim( $search_key ) . '%' );
216
  }
217
+ $alt_search = rtrim( $alt_search, 'AND ' );
218
  $alt_search .= ')';
219
+ $description_search = rtrim( $description_search, 'AND ' );
220
  $description_search .= ')';
221
  $search_where = ' AND (' . $alt_search . ' OR ' . $description_search . ')';
222
  }
223
+ $limit = 0;
224
+ $page_number = WDWLibrary::get( 'page_number_' . $bwg, 0, 'intval' );
225
  if ( $page_number ) {
226
+ $limit = ( (int)$page_number - 1 ) * $albums_per_page;
227
  }
228
  $limit_str = '';
229
  if ( $albums_per_page ) {
230
  $limit_str = 'LIMIT ' . $limit . ',' . $albums_per_page;
231
  }
232
+ if ( WDWLibrary::get( 'action_' . $bwg ) == 'back' && ( $pagination_type == 2 || $pagination_type == 3 ) ) {
233
  if ( $page_number ) {
234
  if ( $albums_per_page ) {
235
  $limit = $albums_per_page * $page_number;
239
  }
240
  // Select all galleries.
241
  if ( $id == 0 ) {
242
+ $query = 'SELECT * FROM `' . $wpdb->prefix . 'bwg_gallery` WHERE `published`=1' . str_replace( '{{table}}', $wpdb->prefix . 'bwg_gallery', $search_where );
243
  $limitation = ' ' . $order_by . ' ' . $limit_str;
244
  $sql = $query . $limitation;
245
+ $rows = $wpdb->get_results( $sql );
246
+ $total = $wpdb->get_var( 'SELECT count(*) FROM `' . $wpdb->prefix . 'bwg_gallery` WHERE `published`=1' . str_replace( '{{table}}', $wpdb->prefix . 'bwg_gallery', $search_where ) );
247
  }
248
  else {
249
+ $query = '( SELECT t.*, t1.preview_image, t1.random_preview_image, t1.name, t1.description, t1.slug, t1.modified_date FROM `' . $wpdb->prefix . 'bwg_album_gallery` as t';
250
  $query .= ' LEFT JOIN `' . $wpdb->prefix . 'bwg_album` as t1 ON (t.is_album=1 AND t.alb_gal_id = t1.id)';
251
  $query .= ' WHERE t.album_id="' . $id . '"';
252
+ $query .= ' AND t1.published=1' . str_replace( '{{table}}', 't1', $search_where );
253
+ $query .= ') ';
254
+ $query .= ' UNION ';
255
+ $query .= '( SELECT t.*, t2.preview_image, t2.random_preview_image, t2.name, t2.description, t2.slug, t2.modified_date FROM `' . $wpdb->prefix . 'bwg_album_gallery` as t';
256
  $query .= ' LEFT JOIN `' . $wpdb->prefix . 'bwg_gallery` as t2 ON (t.is_album=0 AND t.alb_gal_id = t2.id)';
257
  $query .= ' WHERE t.album_id="' . $id . '"';
258
+ $query .= ' AND t2.published=1' . str_replace( '{{table}}', 't2', $search_where );
259
  $query .= ')';
260
  $limitation = ' ' . $order_by . ' ' . $limit_str;
261
  $sql = $query . $limitation;
262
+ $rows = $wpdb->get_results( $sql );
263
+ $total = count( $wpdb->get_results( $query ) );
264
  }
265
  if ( $rows ) {
266
  foreach ( $rows as $row ) {
267
+ $row->def_type = isset( $row->is_album ) && $row->is_album ? 'album' : 'gallery';
268
  if ( $from ) {
269
+ $row->permalink = WDWLibrary::get_custom_post_permalink( array( 'slug' => $row->slug, 'post_type' => $row->def_type ) );
270
  }
271
  else {
272
  $row->permalink = '';
273
  }
274
 
275
+ if ( !empty( $row->preview_image ) ) {
276
+ $row->resolution_thumb = WDWLibrary::get_thumb_size( $row->preview_image );
277
  if ( $row->resolution_thumb == "" ) {
278
+ $row->resolution_thumb = $this->get_album_preview_thumb_dimensions( $row->preview_image );
279
  }
280
 
281
+ $row->preview_image = WDWLibrary::image_url_version( $row->preview_image, $row->modified_date );
282
  }
283
+ if ( !empty( $row->random_preview_image ) ) {
284
+ $row->resolution_thumb = WDWLibrary::get_thumb_size( $row->random_preview_image );
285
  if ( $row->resolution_thumb == "" ) {
286
+ $row->resolution_thumb = $this->get_album_preview_thumb_dimensions( $row->random_preview_image );
287
  }
288
+ $row->random_preview_image = WDWLibrary::image_url_version( $row->random_preview_image, $row->modified_date );
289
  }
290
  if ( !$row->preview_image ) {
291
  $row->preview_image = $row->random_preview_image;
296
  $row->preview_path = BWG()->plugin_dir . '/images/no-image.png';
297
  }
298
  else {
299
+ $parsed_prev_url = parse_url( $row->preview_image, PHP_URL_SCHEME );
300
  if ( $parsed_prev_url == 'http' || $parsed_prev_url == 'https' ) {
301
  $row->preview_path = $row->preview_image;
302
  $row->preview_image = $row->preview_image;
307
  }
308
  }
309
 
310
+ $row->description = wpautop( $row->description );
311
  }
312
  }
313
 
314
+ $page_nav[ 'limit' ] = 1;
315
+ $page_nav[ 'total' ] = $total;
316
+ $page_number = WDWLibrary::get( 'page_number_' . $bwg, 0, 'intval' );
317
  if ( $page_number ) {
318
+ $page_nav[ 'limit' ] = (int)$page_number;
319
  }
320
 
321
  return array( 'rows' => $rows, 'page_nav' => $page_nav );
images/icons/close_search.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 17 17"><defs><style>.a{fill:#5f6368;}</style></defs><g transform="translate(-5 -5)"><path class="a" d="M13.5,5h0A8.489,8.489,0,0,0,5,13.5H5A8.489,8.489,0,0,0,13.5,22h0A8.489,8.489,0,0,0,22,13.5h0A8.489,8.489,0,0,0,13.5,5Zm4.326,11.371a1.015,1.015,0,0,1,0,1.436.986.986,0,0,1-.718.3.957.957,0,0,1-.718-.3l-2.833-2.833L10.7,17.807a.986.986,0,0,1-.718.3.957.957,0,0,1-.718-.3,1.015,1.015,0,0,1,0-1.436l2.852-2.852L9.269,10.686A1.015,1.015,0,1,1,10.7,9.25L13.557,12.1,16.409,9.25a1.015,1.015,0,1,1,1.436,1.436l-2.852,2.852Z"/></g></svg>
images/icons/down_arrow.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="12.506" height="7.285" viewBox="0 0 12.506 7.285"><defs><style>.a{fill:#32373c;stroke:#32373c;stroke-width:0.5px;}</style></defs><path class="a" d="M38.948,19.052a.769.769,0,0,0-1.088,0l-5.228,5.224a.769.769,0,0,0,0,1.088l5.228,5.224A.769.769,0,1,0,38.946,29.5l-4.683-4.68,4.683-4.68a.769.769,0,0,0,0-1.088Z" transform="translate(-18.577 39.442) rotate(-90)"/></svg>
images/icons/up_arrow.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="12.506" height="7.285" viewBox="0 0 12.506 7.285"><defs><style>.a{fill:#32373c;stroke:#32373c;stroke-width:0.5px;}</style></defs><path class="a" d="M6.541,11.774a.769.769,0,0,1-1.088,0L.226,6.551a.769.769,0,0,1,0-1.088L5.453.239A.769.769,0,1,1,6.539,1.327L1.856,6.007l4.683,4.68a.769.769,0,0,1,0,1.088Z" transform="translate(12.25 0.25) rotate(90)"/></svg>
photo-gallery.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Photo Gallery
4
  * Plugin URI: https://10web.io/plugins/wordpress-photo-gallery/?utm_source=photo_gallery&utm_medium=free_plugin
5
  * Description: This plugin is a fully responsive gallery plugin with advanced functionality. It allows having different image galleries for your posts and pages. You can create unlimited number of galleries, combine them into albums, and provide descriptions and tags.
6
- * Version: 1.5.53
7
  * Author: Photo Gallery Team
8
  * Author URI: https://10web.io/plugins/?utm_source=photo_gallery&utm_medium=free_plugin
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -87,7 +87,8 @@ final class BWG {
87
  *
88
  * @return string
89
  */
90
- public function get_abspath( $dirpath ) {
 
91
  $array = explode( "wp-content", $dirpath );
92
  if( isset( $array[0] ) && $array[0] != "" ) {
93
  return $array[0];
@@ -99,12 +100,13 @@ final class BWG {
99
  * Define Constants.
100
  */
101
  private function define_constants() {
 
102
  $this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
103
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
104
  $this->front_url = $this->plugin_url;
105
  $this->main_file = plugin_basename(__FILE__);
106
- $this->plugin_version = '1.5.53';
107
- $this->db_version = '1.5.53';
108
  $this->prefix = 'bwg';
109
  $this->nicename = __('Photo Gallery', $this->prefix);
110
 
@@ -123,8 +125,6 @@ final class BWG {
123
  }
124
 
125
  $this->free_msg = __('This option is disabled in free version.', $this->prefix);
126
-
127
- $this->abspath = defined( 'WP_CONTENT_DIR' ) ? $this->get_abspath( WP_CONTENT_DIR ) : ABSPATH;
128
  }
129
 
130
  /**
3
  * Plugin Name: Photo Gallery
4
  * Plugin URI: https://10web.io/plugins/wordpress-photo-gallery/?utm_source=photo_gallery&utm_medium=free_plugin
5
  * Description: This plugin is a fully responsive gallery plugin with advanced functionality. It allows having different image galleries for your posts and pages. You can create unlimited number of galleries, combine them into albums, and provide descriptions and tags.
6
+ * Version: 1.5.55
7
  * Author: Photo Gallery Team
8
  * Author URI: https://10web.io/plugins/?utm_source=photo_gallery&utm_medium=free_plugin
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
87
  *
88
  * @return string
89
  */
90
+ public static function get_abspath() {
91
+ $dirpath = defined( 'WP_CONTENT_DIR' ) ? WP_CONTENT_DIR : ABSPATH;
92
  $array = explode( "wp-content", $dirpath );
93
  if( isset( $array[0] ) && $array[0] != "" ) {
94
  return $array[0];
100
  * Define Constants.
101
  */
102
  private function define_constants() {
103
+ $this->abspath = self::get_abspath();
104
  $this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
105
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
106
  $this->front_url = $this->plugin_url;
107
  $this->main_file = plugin_basename(__FILE__);
108
+ $this->plugin_version = '1.5.55';
109
+ $this->db_version = '1.5.55';
110
  $this->prefix = 'bwg';
111
  $this->nicename = __('Photo Gallery', $this->prefix);
112
 
125
  }
126
 
127
  $this->free_msg = __('This option is disabled in free version.', $this->prefix);
 
 
128
  }
129
 
130
  /**
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: webdorado,wdsupport,photogallerysupport,10web
3
  Tags: gallery, photo gallery, image gallery, responsive gallery, wordpress gallery plugin, photo albums, gallery slider, gallery lightbox, wordpress photo gallery plugin, fullscreen gallery, watermarking, video gallery
4
  Requires at least: 4.6
5
  Tested up to: 5.4
6
- Stable tag: 1.5.53
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -281,6 +281,12 @@ Choose whether to display random or the first/last specific number of images.
281
  **Theme.** Choose the theme, which will be applied to the gallery/album.
282
 
283
  == Changelog ==
 
 
 
 
 
 
284
 
285
  = 1.5.53 =
286
  * Added: Functionality to duplicate galleries.
3
  Tags: gallery, photo gallery, image gallery, responsive gallery, wordpress gallery plugin, photo albums, gallery slider, gallery lightbox, wordpress photo gallery plugin, fullscreen gallery, watermarking, video gallery
4
  Requires at least: 4.6
5
  Tested up to: 5.4
6
+ Stable tag: 1.5.55
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
281
  **Theme.** Choose the theme, which will be applied to the gallery/album.
282
 
283
  == Changelog ==
284
+ = 1.5.55 =
285
+ * Fixed: Security issue.
286
+ * Fixed: Minor bug.
287
+
288
+ = 1.5.54 =
289
+ * Fixed: Memory leak for users with non default uploads directory.
290
 
291
  = 1.5.53 =
292
  * Added: Functionality to duplicate galleries.
wd/assets/css/img/close.png DELETED
Binary file
wd/assets/css/img/google_cloud.png DELETED
Binary file
wd/assets/css/img/optimizer_banner_1024.png DELETED
Binary file
wd/assets/css/img/optimizer_banner_1280.png DELETED
Binary file
wd/assets/css/img/optimizer_banner_1366.png DELETED
Binary file
wd/assets/css/img/optimizer_banner_1920.png DELETED
Binary file
wd/assets/css/img/optimizer_banner_768.png DELETED
Binary file
wd/assets/css/speedOptimizer_banner.css DELETED
@@ -1,234 +0,0 @@
1
- img.google-cloud-mobile {
2
- display: none;
3
- }
4
- img.google-cloud {
5
- height: 38px;
6
- }
7
- .close-btn {
8
- background-image: url(img/close.png);
9
- background-repeat: no-repeat;
10
- background-size: 14px;
11
- display: inline-block;
12
- width: 14px;
13
- height: 14px;
14
- position: absolute;
15
- top: 20px;
16
- right: 20px;
17
- cursor: pointer;
18
- }
19
- .br-mobile {
20
- display:none;
21
- }
22
- .free-plugins-banner-container {
23
- position: relative;
24
- font-family: Open Sans;
25
- display: flex;
26
- justify-content: space-between;
27
- background-color: white;
28
- box-shadow: 0px 5px 20px #E5E6E8CC;
29
- border-radius: 15px;
30
- height: 282px;
31
- background-image: url(img/optimizer_banner_1920.png);
32
- background-repeat: no-repeat;
33
- padding-left: 410px;
34
- margin: 40px 20px 20px 0;
35
- }
36
- .free-plugins-banner-container .banner-left-container {
37
- padding: 40px 0;
38
- }
39
- .free-plugins-banner-container .banner-left-container .plugin-title {
40
- font-size: 18px;
41
- font-weight: 600;
42
- margin: 0;
43
- letter-spacing: 0;
44
- }
45
- .free-plugins-banner-container .banner-left-container .optimizer-banner-title {
46
- font-size: 50px;
47
- font-weight: 800;
48
- margin: 0;
49
- letter-spacing: 0.41;
50
- padding: 15px 0 10px 0;
51
- line-height: 1.3;
52
- }
53
- .free-plugins-banner-container .banner-left-container .banner-description {
54
- font-size: 18px;
55
- font-weight: 300;
56
- margin: 0;
57
- letter-spacing: 0;
58
- padding: 0 0 20px 0;
59
- }
60
- .free-plugins-banner-container .banner-left-container .line {
61
- width: 40px;
62
- border-bottom: 2px solid #F8C332;
63
- }
64
- .free-plugins-banner-container .banner-right-container {
65
- text-align: center;
66
- margin: 111px 40px 81px 10px;
67
- }
68
- .free-plugins-banner-container .banner-right-container .button-div{
69
- margin-bottom: 8px;
70
- background: #F8C332;
71
- border-radius: 30px;
72
- padding: 20px 61px 19px 61px;
73
- text-transform: uppercase;
74
- }
75
- .free-plugins-banner-container .banner-right-container a{
76
- text-decoration: none;
77
- color: white;
78
- font-size: 20px;
79
- font-weight: 600;
80
- letter-spacing: 0.17px;
81
- }
82
- .free-plugins-banner-container .banner-right-container a:hover{
83
- text-decoration: none;
84
- }
85
- .free-plugins-banner-container .banner-right-container .button-div:hover{
86
- cursor: pointer;
87
- background: #f9bb11;
88
- }
89
- .free-plugins-banner-container .banner-right-container p{
90
- margin: 0;
91
- font-size: 16px;
92
- letter-spacing: 0.13px;
93
- font-weight: 100;
94
- }
95
- @media screen and (max-width: 1660px) {
96
- img.google-cloud {
97
- height: 30px;
98
- }
99
- .free-plugins-banner-container {
100
- height: 247px;
101
- background-image: url(img/optimizer_banner_1366.png);
102
- background-repeat: no-repeat;
103
- padding-left: 300px;
104
- }
105
- .free-plugins-banner-container .banner-left-container .plugin-title,
106
- .free-plugins-banner-container .banner-left-container .banner-description,
107
- .free-plugins-banner-container .banner-right-container a {
108
- font-size: 15px;
109
- }
110
- .free-plugins-banner-container .banner-right-container {
111
- margin: 91px 30px 91px 5px;
112
- }
113
- .free-plugins-banner-container .banner-left-container .optimizer-banner-title {
114
- font-size: 38px;
115
- }
116
- .free-plugins-banner-container .banner-right-container p{
117
- font-size: 12px;
118
- }
119
- .free-plugins-banner-container .banner-right-container .button-div{
120
- padding: 10px 27px;
121
- }
122
- }
123
- @media screen and (max-width: 1281px) {
124
- .free-plugins-banner-container {
125
- background-image: url(img/optimizer_banner_1280.png);
126
- background-repeat: no-repeat;
127
- padding-left: 270px;
128
- }
129
- }
130
- @media screen and (max-width: 1220px) {
131
- .free-plugins-banner-container {
132
- background-image: url(img/optimizer_banner_1024.png);
133
- background-repeat: no-repeat;
134
- height: 262px;
135
- padding-bottom: 25px;
136
- padding-left: 250px;
137
- padding-right: 30px;
138
- display: block;
139
- }
140
- .free-plugins-banner-container .banner-left-container {
141
- padding: 25px 0 10px 0;
142
- }
143
- .free-plugins-banner-container .banner-left-container .plugin-title,
144
- .free-plugins-banner-container .banner-left-container .banner-description {
145
- font-size: 14px;
146
- }
147
- .free-plugins-banner-container .banner-left-container .optimizer-banner-title {
148
- font-size: 36px;
149
- }
150
- .free-plugins-banner-container .banner-right-container {
151
- text-align: center;
152
- width: 150px;
153
- float: right;
154
- margin: 0;
155
- }
156
- .free-plugins-banner-container .banner-right-container .button-div{
157
- width: 97px;
158
- }
159
- }
160
- @media screen and (max-width: 1015px) {
161
- .free-plugins-banner-container {
162
- background-image: url(img/optimizer_banner_768.png);
163
- background-repeat: no-repeat;
164
- padding-left: 155px;
165
- }
166
- .free-plugins-banner-container .banner-right-container {
167
- text-align: center;
168
- width: 150px;
169
- float: right;
170
- margin: 0;
171
- }
172
- }
173
- @media screen and (max-width: 750px) {
174
- img.google-cloud {
175
- display: none;
176
- }
177
- img.google-cloud-mobile {
178
- display: block;
179
- margin-left: auto;
180
- padding-bottom: 20px;
181
- height: 28px;
182
- }
183
- .close-btn {
184
- background-size: 10px;
185
- width: 10px;
186
- height: 10px;
187
- position: absolute;
188
- top: 10px;
189
- right: 10px;
190
- }
191
- .br-mobile {
192
- display: block;
193
- }
194
- .free-plugins-banner-container {
195
- background-image: unset;
196
- padding: 30px 15px;
197
- text-align: center;
198
- height: auto;
199
- margin: 10px 10px 10px 0;
200
- }
201
- .free-plugins-banner-container .banner-left-container {
202
- padding: 0;
203
- }
204
- .free-plugins-banner-container .banner-left-container .line{
205
- display: none;
206
- }
207
- .free-plugins-banner-container .banner-left-container .plugin-title,
208
- .free-plugins-banner-container .banner-left-container .banner-description {
209
- font-size: 16px;
210
- }
211
- .free-plugins-banner-container .banner-left-container .optimizer-banner-title {
212
- font-size: 26px;
213
- padding: 10px 0 5px 0;
214
- }
215
- .free-plugins-banner-container .banner-right-container {
216
- text-align: center;
217
- margin: 0 auto;
218
- float: unset;
219
- }
220
- .free-plugins-banner-container .banner-right-container .button-div{
221
- width: 97px;
222
- margin-top: 10px;
223
- }
224
- }
225
-
226
-
227
-
228
-
229
-
230
-
231
-
232
-
233
-
234
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wd/assets/js/speedOptimizer_banner.js DELETED
@@ -1,18 +0,0 @@
1
- jQuery(document).ready(function(){
2
- jQuery(document).on("click", ".close-btn", function () {
3
- jQuery(".free-plugins-banner-container").css( 'display', 'none' );
4
- jQuery.ajax({
5
- type: "POST",
6
- url: ajaxurl,
7
- data: {
8
- action: 'wdSpeed_banner',
9
- task: "closeBanner",
10
- },
11
- success: function (response) {
12
- jQuery(".free-plugins-banner-container").remove();
13
- },
14
- error: function (jqXHR, textStatus, errorThrown) {
15
- }
16
- });
17
- });
18
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wd/includes/speedOptimizer_banner.php DELETED
@@ -1,69 +0,0 @@
1
- <?php
2
- if ( !defined('ABSPATH') ) {
3
- exit;
4
- }
5
-
6
- class speedOptimizer_banner {
7
- public $config;
8
- public $wd_speedOption_banner;
9
- public $wd_prefix;
10
-
11
- /**
12
- * @param array $options
13
- */
14
- public function __construct( $options = array() ) {
15
- if ( isset($this->wd_speedOption_banner) && $this->wd_speedOption_banner == 1 ) {
16
- return;
17
- }
18
- $this->config = $options;
19
- $this->wd_prefix = $options->prefix;
20
- $this->speedOptimizer_banner_script_style();
21
- $task = isset($_POST['task']) ? sanitize_text_field($_POST['task']) : '';
22
- if( $task == 'closeBanner' ){
23
- $this->closeBanner();
24
- } else {
25
- add_action('admin_notices', array( $this, 'wd_speedOptimizer_banner' ));
26
- }
27
- }
28
-
29
- public function wd_speedOptimizer_banner(){
30
- $config = $this->config;
31
- ?>
32
- <div class="free-plugins-banner-container container wrap">
33
- <span class="close-btn"></span>
34
- <div class="banner-left-container">
35
- <p class="plugin-title"><?php echo $config->plugin_title; ?> created by 10Web</p>
36
- <h2 class="optimizer-banner-title">Managed <br class ="br-mobile"> WordPress Hosting</h2>
37
- <img class="google-cloud-mobile" src="<?php echo $config->wd_url_css . '/img/google_cloud.png'; ?>">
38
- <p class="banner-description">Copy your website with 1click to 10Web & automatically get 95+ PageSpeed Score</p>
39
- <div class="line"></div>
40
- <img class="google-cloud" src="<?php echo $config->wd_url_css . '/img/google_cloud.png'; ?>">
41
- </div>
42
- <div class="banner-right-container">
43
- <div class="button-div">
44
- <a href="https://10web.io/<?php echo $config->utm_source;?>" target="_blank">learn more</a>
45
- </div>
46
- <p>14-Day Free Trial</p>
47
- </div>
48
- </div>
49
-
50
- <?php
51
- }
52
-
53
- /* Include js and css */
54
- public function speedOptimizer_banner_script_style() {
55
- $wd_options = $this->config;
56
- wp_register_script('speedOptimizer_banner_js', $wd_options->wd_url_js . '/speedOptimizer_banner.js', array( 'jquery' ));
57
- wp_register_style('speedOptimizer_banner_css', $wd_options->wd_url_css . '/speedOptimizer_banner.css');
58
- wp_enqueue_style('wd_speedOptimizer-open-sans', 'https://fonts.googleapis.com/css?family=Open+Sans:100,200,300,400,600,700,800&display=swap');
59
- wp_enqueue_script('speedOptimizer_banner_js');
60
- wp_enqueue_style('speedOptimizer_banner_css');
61
- }
62
-
63
- /* Close banner */
64
- public function closeBanner() {
65
- $this->wd_speedOption_banner = 1;
66
- $wd_speedOption_banner = $this->wd_speedOption_banner;
67
- update_option('wd_speedOption_banner', $wd_speedOption_banner);
68
- }
69
- }