Gallery by BestWebSoft - Version 4.6.3

Version Description

  • 04.09.2019 =
  • Update: The deactivation feedback has been changed. Misleading buttons have been removed.
Download this release

Release Info

Developer bestwebsoft
Plugin Icon 128x128 Gallery by BestWebSoft
Version 4.6.3
Comparing to
See all releases

Code changes from version 4.6.2 to 4.6.3

bws_menu/bws_menu.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  * Function for displaying BestWebSoft menu
4
- * Version: 2.1.7
5
  */
6
 
7
  if ( ! function_exists ( 'bws_admin_enqueue_scripts' ) )
@@ -734,7 +734,9 @@ if ( ! function_exists( 'bws_get_banner_array' ) ) {
734
  array( 'cntctfrm_for_ctfrmtdb_hide_banner_on_plugin_page', 'contact-form-plugin/contact_form.php', '3.62' ),
735
  array( 'bwscrrntl_hide_banner_on_plugin_page', 'bws-car-rental/bws-car-rental.php', '0.0.1' ),
736
  array( 'rtng_hide_banner_on_plugin_page', 'rating-bws/rating-bws.php', '1.0.0' ),
737
- array( 'prflxtrflds_hide_banner_on_plugin_page', 'profile-extra-fields/profile-extra-fields.php', '1.1.3' )
 
 
738
  );
739
  }
740
  }
1
  <?php
2
  /*
3
  * Function for displaying BestWebSoft menu
4
+ * Version: 2.2.0
5
  */
6
 
7
  if ( ! function_exists ( 'bws_admin_enqueue_scripts' ) )
734
  array( 'cntctfrm_for_ctfrmtdb_hide_banner_on_plugin_page', 'contact-form-plugin/contact_form.php', '3.62' ),
735
  array( 'bwscrrntl_hide_banner_on_plugin_page', 'bws-car-rental/bws-car-rental.php', '0.0.1' ),
736
  array( 'rtng_hide_banner_on_plugin_page', 'rating-bws/rating-bws.php', '1.0.0' ),
737
+ array( 'prflxtrflds_hide_banner_on_plugin_page', 'profile-extra-fields/profile-extra-fields.php', '1.1.3' ),
738
+ array( 'psttcsv_hide_banner_on_plugin_page', 'post-to-csv/post-to-csv.php', '1.3.4' ),
739
+ array( 'cstmdmnpg_hide_banner_on_plugin_page', 'custom-admin-page/custom-admin-page.php', '1.0.0' )
740
  );
741
  }
742
  }
bws_menu/deactivation-form.php CHANGED
@@ -123,13 +123,12 @@ if ( ! function_exists( 'bws_add_deactivation_feedback_dialog_box' ) ) {
123
  + ' <h2><?php _e( 'Quick Feedback', 'bestwebsoft' ); ?></h2>'
124
  + ' <div class="bws-modal-panel active"><p><?php _e( 'If you have a moment, please let us know why you are deactivating', 'bestwebsoft' ); ?>:</p><ul>' + <?php echo json_encode( $reasons_list_items_html ); ?> + '</ul>'
125
  + ' <label class="bws-modal-anonymous-label">'
126
- + ' <input type="checkbox" checked="checked" />'
127
  + ' <?php _e( 'Send website data and allow to contact me back', 'bestwebsoft' ); ?>'
128
  + ' </label>'
129
  + ' </div>'
130
  + ' </div>'
131
  + ' <div class="bws-modal-footer">'
132
- + ' <a href="#" class="button button-secondary bws-modal-button-close"><?php _e( 'Cancel', 'bestwebsoft' ); ?></a>'
133
  + ' <a href="#" class="button button-primary bws-modal-button-deactivate"></a>'
134
  + ' <div class="clear"></div>'
135
  + ' </div>'
@@ -180,11 +179,17 @@ if ( ! function_exists( 'bws_add_deactivation_feedback_dialog_box' ) ) {
180
  return;
181
  }
182
 
 
 
 
 
 
 
183
  /* If reason is empty, add the error-message class to the message container to change the message color to red. */
184
- if ( 0 === $userReason.val().trim().length ) {
185
  $modal.find( '.message' ).addClass( 'error-message' );
186
  BwsModalDisableDeactivateButton();
187
- }
188
  }, 150 );
189
  });
190
 
@@ -211,9 +216,15 @@ if ( ! function_exists( 'bws_add_deactivation_feedback_dialog_box' ) ) {
211
  $input = $selected_reason.find( 'textarea, input[type="text"]' ),
212
  userReason = ( 0 !== $input.length ) ? $input.val().trim() : '';
213
 
214
- if ( BwsModalIsReasonSelected( 'OTHER' ) && '' === userReason ) {
 
 
 
 
 
 
215
  return;
216
- }
217
 
218
  var is_anonymous = ( $anonymousFeedback.find( 'input' ).is( ':checked' ) ) ? 0 : 1;
219
 
@@ -259,7 +270,7 @@ if ( ! function_exists( 'bws_add_deactivation_feedback_dialog_box' ) ) {
259
 
260
  $modal.find( '.bws-modal-reason-input' ).remove();
261
  $modal.find( '.bws-modal-internal-message' ).hide();
262
- $modal.find( '.bws-modal-button-deactivate' ).text( '<?php _e( 'Submit & Deactivate', 'bestwebsoft' ); ?>' );
263
 
264
  BwsModalEnableDeactivateButton();
265
 
@@ -275,7 +286,13 @@ if ( ! function_exists( 'bws_add_deactivation_feedback_dialog_box' ) ) {
275
 
276
  if ( BwsModalIsReasonSelected( 'OTHER' ) ) {
277
  $modal.find( '.message' ).text( '<?php _e( 'Please tell us the reason so we can improve it.', 'bestwebsoft' ); ?>' ).show();
278
- BwsModalDisableDeactivateButton();
 
 
 
 
 
 
279
  }
280
  }
281
  });
@@ -320,7 +337,13 @@ if ( ! function_exists( 'bws_add_deactivation_feedback_dialog_box' ) ) {
320
 
321
  $modal.find( '.message' ).hide();
322
 
323
- $anonymousFeedback.find( 'input' ).prop( 'checked', true );
 
 
 
 
 
 
324
 
325
  /* Hide, since by default there is no selected reason.*/
326
  $anonymousFeedback.hide();
@@ -342,7 +365,7 @@ if ( ! function_exists( 'bws_add_deactivation_feedback_dialog_box' ) ) {
342
  function BwsModalShowPanel() {
343
  $modal.find( '.bws-modal-panel' ).addClass( 'active' );
344
  /* Update the deactivate button's text */
345
- $modal.find( '.bws-modal-button-deactivate' ).text( '<?php _e( 'Deactivate', 'bestwebsoft' ); ?>' );
346
  }
347
  })(jQuery);
348
  </script>
123
  + ' <h2><?php _e( 'Quick Feedback', 'bestwebsoft' ); ?></h2>'
124
  + ' <div class="bws-modal-panel active"><p><?php _e( 'If you have a moment, please let us know why you are deactivating', 'bestwebsoft' ); ?>:</p><ul>' + <?php echo json_encode( $reasons_list_items_html ); ?> + '</ul>'
125
  + ' <label class="bws-modal-anonymous-label">'
126
+ + ' <input type="checkbox" />'
127
  + ' <?php _e( 'Send website data and allow to contact me back', 'bestwebsoft' ); ?>'
128
  + ' </label>'
129
  + ' </div>'
130
  + ' </div>'
131
  + ' <div class="bws-modal-footer">'
 
132
  + ' <a href="#" class="button button-primary bws-modal-button-deactivate"></a>'
133
  + ' <div class="clear"></div>'
134
  + ' </div>'
179
  return;
180
  }
181
 
182
+ /**
183
+ *
184
+ * @todo Remove after 01.01.2020
185
+ * This code need to be removed after WordPress letter "[WordPress Plugin Directory] Notice: Captcha by BestWebSoft" from 04.09.2019 by kdo
186
+ *
187
+ */
188
  /* If reason is empty, add the error-message class to the message container to change the message color to red. */
189
+ /*if ( 0 === $userReason.val().trim().length ) {
190
  $modal.find( '.message' ).addClass( 'error-message' );
191
  BwsModalDisableDeactivateButton();
192
+ }*/
193
  }, 150 );
194
  });
195
 
216
  $input = $selected_reason.find( 'textarea, input[type="text"]' ),
217
  userReason = ( 0 !== $input.length ) ? $input.val().trim() : '';
218
 
219
+ /**
220
+ *
221
+ * @todo Remove after 01.01.2020
222
+ * This code need to be removed after WordPress letter "[WordPress Plugin Directory] Notice: Captcha by BestWebSoft" from 04.09.2019 by kdo
223
+ *
224
+ */
225
+ /*if ( BwsModalIsReasonSelected( 'OTHER' ) && '' === userReason ) {
226
  return;
227
+ }*/
228
 
229
  var is_anonymous = ( $anonymousFeedback.find( 'input' ).is( ':checked' ) ) ? 0 : 1;
230
 
270
 
271
  $modal.find( '.bws-modal-reason-input' ).remove();
272
  $modal.find( '.bws-modal-internal-message' ).hide();
273
+ $modal.find( '.bws-modal-button-deactivate' ).text( '<?php _e( 'Submit and Deactivate', 'bestwebsoft' ); ?>' );
274
 
275
  BwsModalEnableDeactivateButton();
276
 
286
 
287
  if ( BwsModalIsReasonSelected( 'OTHER' ) ) {
288
  $modal.find( '.message' ).text( '<?php _e( 'Please tell us the reason so we can improve it.', 'bestwebsoft' ); ?>' ).show();
289
+ /**
290
+ *
291
+ * @todo Remove after 01.01.2020
292
+ * This code need to be removed after WordPress letter "[WordPress Plugin Directory] Notice: Captcha by BestWebSoft" from 04.09.2019 by kdo
293
+ *
294
+ */
295
+ //BwsModalDisableDeactivateButton();
296
  }
297
  }
298
  });
337
 
338
  $modal.find( '.message' ).hide();
339
 
340
+ /**
341
+ *
342
+ * @todo Remove after 01.01.2020
343
+ * This code need to be removed after WordPress letter "[WordPress Plugin Directory] Notice: Captcha by BestWebSoft" from 04.09.2019 by kdo
344
+ *
345
+ */
346
+ //$anonymousFeedback.find( 'input' ).prop( 'checked', true );
347
 
348
  /* Hide, since by default there is no selected reason.*/
349
  $anonymousFeedback.hide();
365
  function BwsModalShowPanel() {
366
  $modal.find( '.bws-modal-panel' ).addClass( 'active' );
367
  /* Update the deactivate button's text */
368
+ $modal.find( '.bws-modal-button-deactivate' ).text( '<?php _e( 'Skip and Deactivate', 'bestwebsoft' ); ?>' );
369
  }
370
  })(jQuery);
371
  </script>
bws_menu/fonts/bwsicons.svg CHANGED
@@ -18,7 +18,7 @@
18
  <glyph unicode="&#xe908;" glyph-name="custom-search" d="M1018.56 65.728l-242.24 242.112c39.424 63.872 62.208 139.264 62.208 220.16 0 231.36-187.84 419.136-419.264 419.136-231.808 0-419.264-187.84-419.264-419.136 0-231.808 187.456-419.648 419.328-419.648 84.992 0 163.776 25.28 229.696 68.416l240.512-240.448c12.416-12.416 43.52-1.664 69.312 24l36.032 36.16c25.728 25.664 36.544 56.768 23.68 69.248zM419.264 247.744c-154.688 0-280.32 125.632-280.32 280.256 0 154.688 125.632 279.872 280.32 279.872s279.936-125.248 279.936-279.872c0-154.688-125.248-280.256-279.936-280.256z" />
19
  <glyph unicode="&#xe90a;" glyph-name="donate-button" d="M0 256h320v-320h384v320h320v384h-320v320h-384v-320h-320v-384z" />
20
  <glyph unicode="&#xe90c;" glyph-name="error-log-viewer" d="M576 960v-320h320zM448 352v-128c0-17.664 14.336-32 32-32s32 14.336 32 32v128c0 17.664-14.336 32-32 32s-32-14.336-32-32zM512 960h-384v-1024h768v640h-384v384zM352 128h-160v320h64v-256h96v-64zM640 352c0 52.992 43.008 96 96 96s96-43.008 96-96h-64c0 17.664-14.336 32-32 32s-32-14.336-32-32v-128c0-17.664 14.336-32 32-32s32 14.336 32 32v32h-32v64h96v-96c0-52.992-43.008-96-96-96s-96 43.008-96 96v128zM576 352v-128c0-52.992-43.008-96-96-96s-96 43.008-96 96v128c0 52.992 43.008 96 96 96s96-43.008 96-96z" />
21
- <glyph unicode="&#xe90d;" glyph-name="facebook-button" d="M748.864 771.584l-23.552 1.472-23.552 3.008-55.936 7.296h-3.008c-5.824 0-11.776-1.472-14.656-2.944l-11.84-5.824c-5.824-3.008-10.304-8.896-14.656-13.312-7.36-11.776-10.24-25.024-10.24-41.28 0-72.064 1.536-104.704 1.536-106.176l150.016-1.536-22.144-159.808-129.408-4.48v-512h-201.408v514.88h-120.832v162.112h116.352c1.472 0 4.48 45.312 4.48 143.872 0 7.36 0 11.84 0 19.2s0 14.72 0 22.016c1.472 7.36 1.472 13.248 2.944 20.672 1.472 7.296 4.48 14.656 7.36 20.544 8.832 27.968 21.76 50.048 42.304 69.184h-1.472l35.328 27.968c16.192 8.832 36.864 16.192 58.88 19.136l19.136 4.416c11.84 0 20.672 0 26.496 0l187.008-14.784-19.136-173.632z" />
22
  <glyph unicode="&#xe90e;" glyph-name="featured-posts" d="M128 576h256v-64h-256v64zM128 448h128v-64h-128v64zM128 320h128v-64h-128v64zM128 704h512v-64h-512v64zM128 832h512v-64h-512v64zM768 626.432v234.496c0 54.592-43.136 99.072-96.128 99.072h-575.744c-52.992 0-96.128-44.48-96.128-99.072v-697.792c0-54.656 43.136-99.136 96.128-99.136h304.384c64.576-78.080 162.176-127.872 271.424-127.872 194.432 0 352 157.568 352 351.936 0.064 161.024-108.288 296.512-255.936 338.368zM320 288.064c0-57.728 14.144-112 38.784-160.064h-262.656c-16.96 0-32.128 15.104-32.128 33.728v699.2c0 18.624 15.168 35.072 32.128 35.072h575.68c17.024 0 32.192-16.448 32.192-35.072v-222.528c-10.56 0.96-21.184 1.6-32 1.6-194.432 0-352-157.568-352-351.936zM917.76 317.504l-109.376-97.408 36.48-148.224c8.128-25.408-20.288-50.752-44.544-33.856l-125.632 80.448-125.568-80.448c-20.224-16.96-52.672 4.224-44.544 33.856l32.448 148.224-109.44 97.408c-20.224 16.96-12.16 55.040 12.16 55.040l145.856 12.736 56.704 139.712c12.16 25.472 44.608 25.472 56.768 0l56.704-139.712 145.856-12.736c24.256 0 36.416-38.080 16.128-55.040z" />
23
  <glyph unicode="&#xe910;" glyph-name="gallery" d="M256-64h-256v256h256v-256zM256 320h-256v256h256v-256zM256 704h-256v256h256v-256zM640-64h-256v256h256v-256zM640 320h-256v256h256v-256zM640 704h-256v256h256v-256zM1024-64h-256v256h256v-256zM1024 320h-256v256h256v-256zM1024 704h-256v256h256v-256z" />
24
  <glyph unicode="&#xe911;" glyph-name="google-analytics" d="M1024 489.728l-180.224 110.4c4.608 12.48 7.488 25.792 7.488 39.936 0 64-51.84 115.84-115.84 115.84s-115.84-51.904-115.84-115.84c0-30.4 11.968-57.792 31.040-78.464l-138.24-209.024c-11.904 4.16-24.512 6.848-37.824 6.848-32.192 0-61.248-13.12-82.24-34.304l-65.28 37.44c2.496 9.472 4.288 19.264 4.288 29.504 0 64-51.84 115.84-115.84 115.84s-115.84-51.904-115.84-115.84c0-22.016 6.464-42.368 17.088-59.84l-112.128-112.064c-0.32-0.448 39.616-39.616 40-40.064l112.448 112.448c17.216-10.112 36.992-16.32 58.432-16.32 33.344 0 63.168 14.272 84.288 36.8l64.192-36.8c-3.072-10.432-5.248-21.184-5.248-32.64 0-64 51.84-115.84 115.84-115.84s115.84 51.904 115.84 115.84c0 30.144-11.776 57.408-30.72 78.016l138.432 209.28c11.776-4.032 24.128-6.656 37.248-6.656 29.376 0 55.872 11.264 76.288 29.312l183.616-112.448 28.736 48.64z" />
18
  <glyph unicode="&#xe908;" glyph-name="custom-search" d="M1018.56 65.728l-242.24 242.112c39.424 63.872 62.208 139.264 62.208 220.16 0 231.36-187.84 419.136-419.264 419.136-231.808 0-419.264-187.84-419.264-419.136 0-231.808 187.456-419.648 419.328-419.648 84.992 0 163.776 25.28 229.696 68.416l240.512-240.448c12.416-12.416 43.52-1.664 69.312 24l36.032 36.16c25.728 25.664 36.544 56.768 23.68 69.248zM419.264 247.744c-154.688 0-280.32 125.632-280.32 280.256 0 154.688 125.632 279.872 280.32 279.872s279.936-125.248 279.936-279.872c0-154.688-125.248-280.256-279.936-280.256z" />
19
  <glyph unicode="&#xe90a;" glyph-name="donate-button" d="M0 256h320v-320h384v320h320v384h-320v320h-384v-320h-320v-384z" />
20
  <glyph unicode="&#xe90c;" glyph-name="error-log-viewer" d="M576 960v-320h320zM448 352v-128c0-17.664 14.336-32 32-32s32 14.336 32 32v128c0 17.664-14.336 32-32 32s-32-14.336-32-32zM512 960h-384v-1024h768v640h-384v384zM352 128h-160v320h64v-256h96v-64zM640 352c0 52.992 43.008 96 96 96s96-43.008 96-96h-64c0 17.664-14.336 32-32 32s-32-14.336-32-32v-128c0-17.664 14.336-32 32-32s32 14.336 32 32v32h-32v64h96v-96c0-52.992-43.008-96-96-96s-96 43.008-96 96v128zM576 352v-128c0-52.992-43.008-96-96-96s-96 43.008-96 96v128c0 52.992 43.008 96 96 96s96-43.008 96-96z" />
21
+ <glyph unicode="&#xe90d;" glyph-name="facebook-button" d="M129.2,161.308q0.117-.334.228-0.672l0.011-.033c0.074-.227.147-0.455,0.216-0.684,0,0,0,0,0-.006a33.324,33.324,0,0,0,.856-3.5c0.009-.05.019-0.1,0.028-0.148q0.048-.261.091-0.524l0.045-.27c0.024-.156.047-0.314,0.07-0.471,0.016-.11.032-0.22,0.046-0.33,0.02-.146.038-0.292,0.056-0.439,0.015-.124.029-0.248,0.043-0.373s0.029-.274.042-0.411,0.025-.275.037-0.413,0.021-.255.031-0.383c0.011-.152.02-0.305,0.029-0.458,0.006-.116.014-0.232,0.02-0.349,0.008-.175.014-0.352,0.02-0.529,0-.095.007-0.189,0.01-0.285,0.006-.273.01-0.546,0.01-0.821,0-.3-0.005-0.6-0.013-0.905l-0.009-.264q-0.012-.336-0.03-0.671c0-.085-0.009-0.171-0.014-0.256q-0.056-.9-0.159-1.786c-0.009-.077-0.019-0.154-0.028-0.231q-0.043-.348-0.093-0.695c-0.01-.071-0.02-0.142-0.031-0.212q-0.135-.9-0.317-1.774l-0.036-.168q-0.079-.376-0.168-0.75l-0.033-.142q-0.216-.894-0.48-1.769c-0.009-.031-0.018-0.061-0.028-0.092q-0.125-.411-0.26-0.818c-0.006-.02-0.013-0.04-0.019-0.059-0.1-.293-0.2-0.584-0.3-0.872a0,0,0,0,1,0,0,33.127,33.127,0,0,0-1.507-3.488q-1.644.135-3.312,0.137A40.1,40.1,0,0,1,90.8,117.436a33.467,33.467,0,1,0,38.141,44.578h0c0.085-.224.167-0.45,0.248-0.677C129.188,161.327,129.191,161.317,129.2,161.308Zm-16.953-3.274a7.825,7.825,0,0,1-5.734-2.489l-11.146,6.418A7.844,7.844,0,1,1,93.7,159l11.078-6.379a7.8,7.8,0,0,1,0-4.81L93.7,141.429a7.8,7.8,0,1,1,1.659-2.967l11.146,6.419A7.831,7.831,0,1,1,112.242,158.034ZM98.39,116.769l0.01,0.013q0.264,0.318.537,0.63l0.128,0.144c0.144,0.163.289,0.326,0.437,0.486,0.057,0.062.115,0.123,0.172,0.184,0.135,0.145.271,0.29,0.409,0.432l0.2,0.2c0.133,0.136.267,0.27,0.4,0.4l0.209,0.2q0.2,0.195.406,0.386c0.071,0.068.143,0.134,0.216,0.2,0.138,0.127.277,0.252,0.417,0.377l0.216,0.192c0.145,0.126.291,0.25,0.437,0.374l0.21,0.177q0.234,0.194.472,0.383l0.187,0.151q0.272,0.213.547,0.422l0.124,0.094q0.692,0.519,1.41,1l0.084,0.055c0.207,0.138.416,0.275,0.626,0.408l0.195,0.122q0.263,0.165.528,0.325l0.241,0.142q0.246,0.145.495,0.287c0.088,0.05.176,0.1,0.265,0.147,0.161,0.09.322,0.178,0.485,0.265l0.278,0.146c0.161,0.084.322,0.166,0.485,0.248l0.284,0.141c0.164,0.08.329,0.158,0.494,0.236l0.283,0.132c0.17,0.078.342,0.153,0.513,0.228,0.092,0.04.182,0.081,0.274,0.12,0.183,0.078.366,0.153,0.551,0.228l0.244,0.1c0.213,0.084.428,0.165,0.643,0.246l0.162,0.061q0.819,0.3,1.659.56l0.183,0.054c0.216,0.065.432,0.129,0.649,0.19l0.271,0.073c0.19,0.052.38,0.1,0.571,0.151,0.1,0.026.2,0.05,0.307,0.075q0.271,0.066.545,0.128l0.326,0.071c0.178,0.038.357,0.075,0.535,0.11l0.338,0.064c0.177,0.033.356,0.065,0.535,0.095l0.339,0.057q0.273,0.042.546,0.081l0.335,0.047c0.188,0.025.377,0.047,0.567,0.069,0.106,0.012.212,0.025,0.318,0.036,0.2,0.022.407,0.04,0.611,0.058l0.281,0.025c0.242,0.019.486,0.034,0.73,0.048l0.167,0.01q0.879,0.047,1.769.047a33.511,33.511,0,0,0,13.184-2.685h0q0.68-.289,1.342-0.608l0.047-.023c0.2-.094.39-0.19,0.583-0.288l0.1-.053q0.274-.141.546-0.286l0.087-.046q0.631-.339,1.247-0.7l0.062-.037q0.264-.158.525-0.321l0.138-.086q0.23-.144.457-0.293l0.14-.091c0.168-.111.334-0.222,0.5-0.336l0.074-.05q0.291-.2.576-0.405l0.072-.053q0.238-.172.474-0.349l0.164-.125c0.127-.1.254-0.194,0.379-0.293l0.18-.141c0.126-.1.251-0.2,0.376-0.3l0.157-.128q0.258-.215.512-0.433c0.028-.023.054-0.048,0.082-0.071,0.141-.123.282-0.247,0.421-0.372,0.064-.057.126-0.115,0.189-0.172,0.1-.094.206-0.188,0.308-0.283,0.034-.032.069-0.063,0.1-0.095l0,0a33.533,33.533,0,0,0,7.723-10.94h-17.8a8.846,8.846,0,0,1-7.621,4.383H112.156a3.463,3.463,0,1,1,0-6.925h-1.934a3.463,3.463,0,1,1,0-6.925h-1.933a3.463,3.463,0,1,1,0-6.925h-1.934a3.463,3.463,0,1,1,0-6.925h18.5s-2.321-10.558-2.359-11.074a3.363,3.363,0,0,1,2.974-3.828,4.228,4.228,0,0,1,4.748,2.49l7.069,16.707H157.31a33.539,33.539,0,1,0-58.92,26.953h0Zm62.067,0.322q-1.314,0-2.6.1a40.038,40.038,0,0,1-23.633,16.958c0.076,0.171.152,0.341,0.225,0.513a39.959,39.959,0,0,1,0,31.1q-0.78,1.842-1.735,3.583A33.512,33.512,0,1,0,160.457,117.091Zm12.454,52.136H148a4.552,4.552,0,0,1-4.375-5.845,18.651,18.651,0,0,1,9.73-11.583,11.255,11.255,0,1,1,14.2,0,18.651,18.651,0,0,1,9.73,11.583A4.552,4.552,0,0,1,172.911,169.227Z" />
22
  <glyph unicode="&#xe90e;" glyph-name="featured-posts" d="M128 576h256v-64h-256v64zM128 448h128v-64h-128v64zM128 320h128v-64h-128v64zM128 704h512v-64h-512v64zM128 832h512v-64h-512v64zM768 626.432v234.496c0 54.592-43.136 99.072-96.128 99.072h-575.744c-52.992 0-96.128-44.48-96.128-99.072v-697.792c0-54.656 43.136-99.136 96.128-99.136h304.384c64.576-78.080 162.176-127.872 271.424-127.872 194.432 0 352 157.568 352 351.936 0.064 161.024-108.288 296.512-255.936 338.368zM320 288.064c0-57.728 14.144-112 38.784-160.064h-262.656c-16.96 0-32.128 15.104-32.128 33.728v699.2c0 18.624 15.168 35.072 32.128 35.072h575.68c17.024 0 32.192-16.448 32.192-35.072v-222.528c-10.56 0.96-21.184 1.6-32 1.6-194.432 0-352-157.568-352-351.936zM917.76 317.504l-109.376-97.408 36.48-148.224c8.128-25.408-20.288-50.752-44.544-33.856l-125.632 80.448-125.568-80.448c-20.224-16.96-52.672 4.224-44.544 33.856l32.448 148.224-109.44 97.408c-20.224 16.96-12.16 55.040 12.16 55.040l145.856 12.736 56.704 139.712c12.16 25.472 44.608 25.472 56.768 0l56.704-139.712 145.856-12.736c24.256 0 36.416-38.080 16.128-55.040z" />
23
  <glyph unicode="&#xe910;" glyph-name="gallery" d="M256-64h-256v256h256v-256zM256 320h-256v256h256v-256zM256 704h-256v256h256v-256zM640-64h-256v256h256v-256zM640 320h-256v256h256v-256zM640 704h-256v256h256v-256zM1024-64h-256v256h256v-256zM1024 320h-256v256h256v-256zM1024 704h-256v256h256v-256z" />
24
  <glyph unicode="&#xe911;" glyph-name="google-analytics" d="M1024 489.728l-180.224 110.4c4.608 12.48 7.488 25.792 7.488 39.936 0 64-51.84 115.84-115.84 115.84s-115.84-51.904-115.84-115.84c0-30.4 11.968-57.792 31.040-78.464l-138.24-209.024c-11.904 4.16-24.512 6.848-37.824 6.848-32.192 0-61.248-13.12-82.24-34.304l-65.28 37.44c2.496 9.472 4.288 19.264 4.288 29.504 0 64-51.84 115.84-115.84 115.84s-115.84-51.904-115.84-115.84c0-22.016 6.464-42.368 17.088-59.84l-112.128-112.064c-0.32-0.448 39.616-39.616 40-40.064l112.448 112.448c17.216-10.112 36.992-16.32 58.432-16.32 33.344 0 63.168 14.272 84.288 36.8l64.192-36.8c-3.072-10.432-5.248-21.184-5.248-32.64 0-64 51.84-115.84 115.84-115.84s115.84 51.904 115.84 115.84c0 30.144-11.776 57.408-30.72 78.016l138.432 209.28c11.776-4.032 24.128-6.656 37.248-6.656 29.376 0 55.872 11.264 76.288 29.312l183.616-112.448 28.736 48.64z" />
bws_menu/product_list.php CHANGED
@@ -83,7 +83,10 @@ $bws_plugins = array(
83
  'name' => 'Custom Admin Page',
84
  'description' => __( 'Add unlimited custom pages to WordPress admin dashboard.', 'bestwebsoft' ),
85
  'link' => 'https://bestwebsoft.com/products/wordpress/plugins/custom-admin-page/?k=9ac03f16c25e845e8e055a221c3e1467&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
86
- 'settings' => 'admin.php?page=custom-admin-page.php'
 
 
 
87
  ),
88
  'custom-fields-search/custom-fields-search.php' => array(
89
  'category' => array( 'navigation' ),
@@ -118,7 +121,7 @@ $bws_plugins = array(
118
  ),
119
  'facebook-button-plugin/facebook-button-plugin.php' => array(
120
  'category' => array( 'smm' ),
121
- 'name' => 'Facebook Button',
122
  'description' => __( 'Add Facebook Follow, Like, and Share buttons to WordPress posts, pages, and widgets.', 'bestwebsoft' ),
123
  'link' => 'https://bestwebsoft.com/products/wordpress/plugins/facebook-like-button/?k=05ec4f12327f55848335802581467d55&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
124
  'settings' => 'admin.php?page=facebook-button-plugin.php',
@@ -305,7 +308,10 @@ $bws_plugins = array(
305
  'name' => 'Post to CSV',
306
  'description' => __( 'Export WordPress posts to CSV file format easily. Configure data order.', 'bestwebsoft' ),
307
  'link' => 'https://bestwebsoft.com/products/wordpress/plugins/post-to-csv/?k=653aa55518ae17409293a7a894268b8f&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
308
- 'settings' => 'admin.php?page=post-to-csv.php'
 
 
 
309
  ),
310
  'profile-extra-fields/profile-extra-fields.php' => array(
311
  'category' => array( 'admin-tools' ),
83
  'name' => 'Custom Admin Page',
84
  'description' => __( 'Add unlimited custom pages to WordPress admin dashboard.', 'bestwebsoft' ),
85
  'link' => 'https://bestwebsoft.com/products/wordpress/plugins/custom-admin-page/?k=9ac03f16c25e845e8e055a221c3e1467&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
86
+ 'settings' => 'admin.php?page=custom-admin-page.php',
87
+ 'pro_version' => 'custom-admin-page-pro/custom-admin-page-pro.php',
88
+ 'purchase' => 'https://bestwebsoft.com/products/wordpress/plugins/custom-admin-page/buy/?k=b986f456dba092b537f1a7755a363be9&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
89
+ 'pro_settings' => 'admin.php?page=custom-admin-page.php'
90
  ),
91
  'custom-fields-search/custom-fields-search.php' => array(
92
  'category' => array( 'navigation' ),
121
  ),
122
  'facebook-button-plugin/facebook-button-plugin.php' => array(
123
  'category' => array( 'smm' ),
124
+ 'name' => 'Bestwebsoft Buttons for Facebook',
125
  'description' => __( 'Add Facebook Follow, Like, and Share buttons to WordPress posts, pages, and widgets.', 'bestwebsoft' ),
126
  'link' => 'https://bestwebsoft.com/products/wordpress/plugins/facebook-like-button/?k=05ec4f12327f55848335802581467d55&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
127
  'settings' => 'admin.php?page=facebook-button-plugin.php',
308
  'name' => 'Post to CSV',
309
  'description' => __( 'Export WordPress posts to CSV file format easily. Configure data order.', 'bestwebsoft' ),
310
  'link' => 'https://bestwebsoft.com/products/wordpress/plugins/post-to-csv/?k=653aa55518ae17409293a7a894268b8f&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
311
+ 'settings' => 'admin.php?page=post-to-csv.php',
312
+ 'pro_version' => 'post-to-csv-pro/post-to-csv-pro.php',
313
+ 'purchase' => 'https://bestwebsoft.com/products/wordpress/plugins/post-to-csv/buy/?k=b6521601d1579ed9c556ba98234f2d8f&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version,
314
+ 'pro_settings' => 'admin.php?page=post-to-csv-pro.php'
315
  ),
316
  'profile-extra-fields/profile-extra-fields.php' => array(
317
  'category' => array( 'admin-tools' ),
gallery-plugin.php CHANGED
@@ -6,7 +6,7 @@ Description: Add beautiful galleries, albums & images to your Wordpress website
6
  Author: BestWebSoft
7
  Text Domain: gallery-plugin
8
  Domain Path: /languages
9
- Version: 4.6.2
10
  Author URI: https://bestwebsoft.com/
11
  License: GPLv2 or later
12
  */
6
  Author: BestWebSoft
7
  Text Domain: gallery-plugin
8
  Domain Path: /languages
9
+ Version: 4.6.3
10
  Author URI: https://bestwebsoft.com/
11
  License: GPLv2 or later
12
  */
includes/widgets.php ADDED
@@ -0,0 +1,454 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Include all plugin widgets
4
+ */
5
+
6
+ /* Registing Widget */
7
+ if ( ! function_exists( 'gllr_register_widget' ) ) {
8
+ function gllr_register_widget() {
9
+ register_widget( 'gallery_categories_widget' );
10
+ register_widget( 'latest_galleries_widget' );
11
+ }
12
+ }
13
+
14
+ /**
15
+ * Class extends WP class WP_Widget, and create new widget
16
+ * Gallery Categories widget
17
+ */
18
+ if ( ! class_exists( 'gallery_categories_widget' ) ) {
19
+ class gallery_categories_widget extends WP_Widget {
20
+ /**
21
+ * constructor of class
22
+ */
23
+ public function __construct() {
24
+ $widget_ops = array( 'classname' => 'gallery_categories_widget', 'description' => __( "A list or dropdown of Gallery categories.", 'gallery-plugin' ) );
25
+ parent::__construct( 'gallery_categories_widget', __( 'Gallery Categories', 'gallery-plugin' ), $widget_ops );
26
+ }
27
+ /**
28
+ * Function to displaying widget in front end
29
+ *
30
+ */
31
+ public function widget( $args, $instance ) {
32
+ global $wp_version;
33
+ $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Gallery Categories', 'gallery-plugin' ) : $instance['title'], $instance, $this->id_base );
34
+ $c = ! empty( $instance['count'] ) ? '1' : '0';
35
+ $h = ! empty( $instance['hierarchical'] ) ? '1' : '0';
36
+ $d = ! empty( $instance['dropdown'] ) ? '1' : '0';
37
+
38
+ /* Get value of HTTP Request */
39
+ if ( isset( $_REQUEST['gallery_categories'] ) ) {
40
+ $term = get_term_by( 'slug', $_REQUEST['gallery_categories'], 'gallery_categories' );
41
+ } else {
42
+ global $wp;
43
+ $http_request = parse_url( add_query_arg( $wp->query_string, '', home_url( $wp->request ) ) );
44
+ if ( isset( $http_request['query'] ) && preg_match( '/gallery_categories/' ,$http_request['query'] ) )
45
+ $term = get_term_by( 'slug', substr( $http_request['query'], strpos( $http_request['query'], "=" ) + 1 ), 'gallery_categories' );
46
+ }
47
+
48
+ echo $args['before_widget'];
49
+ if ( $title ) {
50
+ echo $args['before_title'] . $title . $args['after_title'];
51
+ }
52
+ $cat_args = array(
53
+ 'orderby' => 'name',
54
+ 'show_count' => $c,
55
+ 'hierarchical' => $h
56
+ );
57
+ if ( $d ) {
58
+ static $first_dropdown = true;
59
+ $dropdown_id = ( $first_dropdown ) ? 'gllr_cat' : 'gllr_cat_' . $this->number;
60
+ $first_dropdown = false;
61
+ echo '<label class="screen-reader-text" for="' . esc_attr( $dropdown_id ) . '">' . $title . '</label>';
62
+ if ( 4.2 >= $wp_version ) {
63
+ $cat_args['walker'] = new Gllr_CategoryDropdown();
64
+ $cat_args['selected'] = isset( $term ) && ( ! empty( $term ) ) ? $term->slug : '-1';
65
+ } else {
66
+ $cat_args['value_field'] = 'slug';
67
+ $cat_args['selected'] = isset( $term ) && ( ! empty( $term ) ) ? $term->term_id : -1;
68
+ }
69
+ $cat_args['show_option_none'] = __( 'Select Gallery Category', 'gallery-plugin' );
70
+ $cat_args['taxonomy'] = 'gallery_categories';
71
+ $cat_args['title_li'] = __( 'Gallery Categories', 'gallery-plugin' );
72
+ $cat_args['name'] = 'gallery_categories';
73
+ $cat_args['id'] = $dropdown_id; ?>
74
+ <form action="<?php bloginfo( 'url' ); ?>/" method="get">
75
+ <?php wp_dropdown_categories( apply_filters( 'widget_categories_dropdown_args', $cat_args ) ); ?>
76
+ <script type='text/javascript'>
77
+ (function() {
78
+ var dropdown = document.getElementById( "<?php echo esc_js( $dropdown_id ); ?>" );
79
+ function onCatChange() {
80
+ if ( dropdown.options[ dropdown.selectedIndex ].value != -1 ) {
81
+ location.href = "<?php echo home_url(); ?>/?gallery_categories=" + dropdown.options[ dropdown.selectedIndex ].value;
82
+ }
83
+ }
84
+ dropdown.onchange = onCatChange;
85
+ })();
86
+ </script>
87
+ <noscript>
88
+ <br />
89
+ <input type="submit" value="<?php _e( 'View', 'gallery-plugin' ); ?>" />
90
+ </noscript>
91
+ </form>
92
+ <?php } else { ?>
93
+ <ul>
94
+ <?php $cat_args['show_option_none'] = __( 'Gallery Categories', 'gallery-plugin' );
95
+ $cat_args['taxonomy'] = 'gallery_categories';
96
+ $cat_args['title_li'] = '';
97
+ wp_list_categories( apply_filters( 'widget_categories_args', $cat_args ) ); ?>
98
+ </ul>
99
+ <?php }
100
+ echo $args['after_widget'];
101
+ }
102
+ /**
103
+ * Function to save widget settings
104
+ * @param array() $new_instance array with new settings
105
+ * @param array() $old_instance array with old settings
106
+ * @return array() $instance array with updated settings
107
+ */
108
+ public function update( $new_instance, $old_instance ) {
109
+ $instance = $old_instance;
110
+ $instance['title'] = strip_tags( $new_instance['title'] );
111
+ $instance['count'] = ! empty( $new_instance['count'] ) ? 1 : 0;
112
+ $instance['hierarchical'] = ! empty( $new_instance['hierarchical'] ) ? 1 : 0;
113
+ $instance['dropdown'] = ! empty( $new_instance['dropdown'] ) ? 1 : 0;
114
+ return $instance;
115
+ }
116
+ /**
117
+ * Function to displaying widget settings in back end
118
+ * @param array() $instance array with widget settings
119
+ * @return void
120
+ */
121
+ public function form( $instance ) {
122
+ $instance = wp_parse_args( ( array ) $instance, array( 'title' => '' ) );
123
+ $title = esc_attr( $instance['title'] );
124
+ $count = isset( $instance['count'] ) ? ( bool ) $instance['count'] : false;
125
+ $hierarchical = isset( $instance['hierarchical'] ) ? ( bool ) $instance['hierarchical'] : false;
126
+ $dropdown = isset( $instance['dropdown'] ) ? ( bool ) $instance['dropdown'] : false; ?>
127
+ <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'gallery-plugin' ); ?></label>
128
+ <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
129
+ <p><input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'dropdown' ); ?>" name="<?php echo $this->get_field_name( 'dropdown' ); ?>"<?php checked( $dropdown ); ?> />
130
+ <label for="<?php echo $this->get_field_id( 'dropdown' ); ?>"><?php _e( 'Display as dropdown', 'gallery-plugin' ); ?></label><br />
131
+ <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'count' ); ?>" name="<?php echo $this->get_field_name( 'count' ); ?>"<?php checked( $count ); ?> />
132
+ <label for="<?php echo $this->get_field_id( 'count' ); ?>"><?php _e( 'Show gallery counts', 'gallery-plugin' ); ?></label><br />
133
+ <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'hierarchical' ); ?>" name="<?php echo $this->get_field_name( 'hierarchical' ); ?>"<?php checked( $hierarchical ); ?> />
134
+ <label for="<?php echo $this->get_field_id( 'hierarchical' ); ?>"><?php _e( 'Show hierarchy', 'gallery-plugin' ); ?></label></p>
135
+ <?php }
136
+ }
137
+ }
138
+
139
+ /**
140
+ * Class extends WP class WP_Widget, and create new widget
141
+ * Latest Galleries
142
+ */
143
+ if ( ! class_exists( 'latest_galleries_widget' ) ) {
144
+ class latest_galleries_widget extends WP_Widget {
145
+ /**
146
+ * constructor of class
147
+ */
148
+ public function __construct() {
149
+ $widget_ops = array( 'classname' => 'latest_galleries_widget',
150
+ 'description' => __( "Displays the latest galleries and a link to the Galleries page.", 'gallery-plugin' )
151
+ );
152
+ parent::__construct( 'gllr_latest_galleries_widget', __( 'Latest Galleries', 'gallery-plugin' ), $widget_ops );
153
+ }
154
+
155
+ /**
156
+ * Function to displaying widget in front end
157
+ *
158
+ */
159
+ public function widget( $args, $instance ) {
160
+ global $wp_version, $gllr_options;
161
+ $widget_title = ( ! empty( $instance['widget_title'] ) ) ? apply_filters( 'widget_title', $instance['widget_title'], $instance, $this->id_base ) : '';
162
+ $widget_galleries_button_text = ( ! empty( $instance['widget_galleries_button_text'] ) ) ? apply_filters( 'widget_galleries_button_text', $instance['widget_galleries_button_text'], $instance, $this->id_base ) : '';
163
+ $widget_galleries_button_link = ( ! empty( $instance['widget_galleries_button_link'] ) ) ? apply_filters( 'widget_galleries_button_link', $instance['widget_galleries_button_link'], $instance, $this->id_base ) : '';
164
+ $widget_galleries_count_display = ( ! empty( $instance['widget_galleries_count_display'] ) ) ? apply_filters( 'widget_galleries_count_display', $instance['widget_galleries_count_display'], $instance, $this->id_base ) : '4';
165
+ $widget_galleries_hover_color = isset( $instance['widget_galleries_hover_color'] ) ? stripslashes( esc_html( $instance['widget_galleries_hover_color'] ) ) : '#F1F1F180';
166
+ $widget_galleries_grid_wrapper_end = '</div>';
167
+
168
+ if ( ! empty( $widget_title ) ) {
169
+ echo $args['before_widget'] . $args['before_title'] . $widget_title . $args['after_title'];
170
+ } else {
171
+ echo $args['before_widget'] . $widget_title;
172
+ }
173
+
174
+ $gallery_posts = get_posts( array(
175
+ 'numberposts' => $widget_galleries_count_display,
176
+ 'post_type' => $gllr_options['post_type_name']
177
+ ) );
178
+
179
+ if ( 0 < count( $gallery_posts ) ) {
180
+ if ( 6 > count( $gallery_posts ) ) {
181
+ $count_column = 4;
182
+ $count_row = 2;
183
+ $widget_galleries_grid_wrapper = '<div class="gllr-widget-grid" style="grid-template-columns: repeat(' . $count_column . ', 1fr);">';
184
+ } else if( 10 > count( $gallery_posts ) ) {
185
+ $count_column = 4;
186
+ $count_row = 3;
187
+ $widget_galleries_grid_wrapper = '<div class="gllr-widget-grid" style="grid-template-columns: repeat(' . $count_column . ', 1fr);">';
188
+ } else {
189
+ $count_column = 6;
190
+ $count_row = 3;
191
+ $widget_galleries_grid_wrapper = '<div class="gllr-widget-grid" style="grid-template-columns: repeat(' . $count_column . ', 1fr);">';
192
+ }
193
+
194
+ /* get properties of cell for each gallery and button */
195
+ $gllr_cells_properties = gllr_generate_collage_template( count( $gallery_posts ) + 1, $count_column, $count_row );
196
+ $gllr_image_number = 1;
197
+
198
+ echo $widget_galleries_grid_wrapper;
199
+ /* output galleries in grid */
200
+ foreach ( $gallery_posts as $post ) {
201
+ $style = 'style="grid-column-start: ' . $gllr_cells_properties[ $gllr_image_number ]['x'] . '; grid-row-start: ' . $gllr_cells_properties[ $gllr_image_number ]['y'] . '"';
202
+ echo '<div class="gllr-widget-grid-item ' . $gllr_cells_properties[ $gllr_image_number ]['class'] . '" ' . $style . '>' . get_the_post_thumbnail( $post->ID, 'full' ) . '
203
+ <div class="gllr-widget-grid-item-hover" style="background:' . $widget_galleries_hover_color . '80;">
204
+ <div class="gllr-widget-content-center">
205
+ <a href="' . get_permalink( $post->ID ) . '">' . get_the_title( $post->ID ) . '</a>
206
+ </div>
207
+ </div>
208
+ </div>';
209
+ $gllr_image_number ++;
210
+ }
211
+
212
+ /* output button in grid */
213
+ echo '<div class="gllr-widget-grid-item gllr-widget-content-center ' . $gllr_cells_properties[ $gllr_image_number ]['class'] . '" style="grid-column-start: ' . $gllr_cells_properties[ $gllr_image_number ]['x'] . '; grid-row-start: ' . $gllr_cells_properties[ $gllr_image_number ]['y'] . '">
214
+ <a class="button gllr-widget-button" href="' . get_permalink( $widget_galleries_button_link ) . '">' . $widget_galleries_button_text . '</a>
215
+ </div>';
216
+ echo $widget_galleries_grid_wrapper_end;
217
+ } else {
218
+ _e( 'No galleries', 'gallery-plugin' );
219
+ }
220
+ echo $args['after_widget'];
221
+ }
222
+
223
+ /**
224
+ * Function to save widget settings
225
+ *
226
+ * @param array() $new_instance array with new settings
227
+ * @param array() $old_instance array with old settings
228
+ *
229
+ * @return array() $instance array with updated settings
230
+ */
231
+ public function update( $new_instance, $old_instance ) {
232
+ $instance = $old_instance;
233
+ $instance['widget_title'] = ( ! empty( $new_instance['widget_title'] ) ) ? strip_tags( $new_instance['widget_title'] ) : null;
234
+ $instance['widget_galleries_button_text'] = isset( $new_instance['widget_galleries_button_text'] ) ? stripslashes( esc_html( $new_instance['widget_galleries_button_text'] ) ) : null;
235
+ $instance['widget_galleries_button_link'] = isset( $new_instance['widget_galleries_button_link'] ) ? stripslashes( esc_html( $new_instance['widget_galleries_button_link'] ) ) : null;
236
+ $instance['widget_galleries_count_display'] = isset( $new_instance['widget_galleries_count_display'] ) ? stripslashes( esc_html( $new_instance['widget_galleries_count_display'] ) ) : 4;
237
+ $instance['widget_galleries_hover_color'] = isset( $new_instance['widget_galleries_hover_color'] ) ? stripslashes( esc_html( $new_instance['widget_galleries_hover_color'] ) ) : '#F1F1F1';
238
+
239
+ return $instance;
240
+ }
241
+
242
+ /**
243
+ * Function to displaying widget settings in back end
244
+ *
245
+ * @param array() $instance array with widget settings
246
+ *
247
+ * @return void
248
+ */
249
+ public function form( $instance ) {
250
+ global $gllr_options;
251
+ if ( empty( $gllr_options ) ) {
252
+ gllr_settings();
253
+ }
254
+ $widget_title = isset( $instance['widget_title'] ) ? stripslashes( esc_html( $instance['widget_title'] ) ) : null;
255
+ $widget_galleries_button_text = isset( $instance['widget_galleries_button_text'] ) ? stripslashes( esc_html( $instance['widget_galleries_button_text'] ) ) : __( 'View more', 'gallery-plugin' );
256
+ $widget_galleries_button_link = isset( $instance['widget_galleries_button_link'] ) ? stripslashes( esc_html( $instance['widget_galleries_button_link'] ) ) : ( isset( $gllr_options['page_id_gallery_template'] ) ? $gllr_options['page_id_gallery_template'] : 0 );
257
+ $widget_galleries_count_display = isset( $instance['widget_galleries_count_display'] ) ? stripslashes( esc_html( $instance['widget_galleries_count_display'] ) ) : 4;
258
+ $widget_galleries_hover_color = isset( $instance['widget_galleries_hover_color'] ) ? stripslashes( esc_html( $instance['widget_galleries_hover_color'] ) ) : '#F1F1F1';?>
259
+
260
+ <p>
261
+ <label for="<?php echo $this->get_field_id( 'widget_title' ); ?>">
262
+ <?php _e( 'Title', 'gallery-plugin' ); ?>:
263
+ <input class="widefat" id="<?php echo $this->get_field_id( 'widget_title' ); ?>"
264
+ name="<?php echo $this->get_field_name( 'widget_title' ); ?>" type="text"
265
+ value="<?php echo esc_attr( $widget_title ); ?>"/>
266
+ </label>
267
+ </p>
268
+ <p>
269
+ <label for="<?php echo $this->get_field_id( 'widget_galleries_button_text' ); ?>">
270
+ <?php _e( 'Button Text', 'gallery-plugin' ); ?>:
271
+ <input class="widefat" id="<?php echo $this->get_field_id( 'widget_galleries_button_text' ); ?>"
272
+ name="<?php echo $this->get_field_name( 'widget_galleries_button_text' ); ?>" type="text"
273
+ value="<?php echo esc_attr( $widget_galleries_button_text ); ?>"/>
274
+ </label>
275
+ </p>
276
+ <p>
277
+ <label for="<?php echo $this->get_field_id( 'widget_galleries_button_link' ); ?>">
278
+ <?php _e( 'Link to the Galleries Page', 'gallery-plugin' ); ?>:
279
+ <?php $args = array(
280
+ 'depth' => 0,
281
+ 'selected' => $widget_galleries_button_link,
282
+ 'echo' => 1,
283
+ 'name' => $this->get_field_name( 'widget_galleries_button_link' ),
284
+ 'class' => 'widefat'
285
+ );
286
+ wp_dropdown_pages( $args ) ?>
287
+ </label>
288
+ </p>
289
+ <p>
290
+ <label for="<?php echo $this->get_field_id( 'widget_galleries_count_display' ); ?>">
291
+ <?php _e( 'Number of Galleries to Display', 'gallery-plugin' ); ?>:
292
+ <select class="widefat" id="<?php echo $this->get_field_id( 'widget_galleries_count_display' ); ?>"
293
+ name="<?php echo $this->get_field_name( 'widget_galleries_count_display' ); ?>">
294
+ <option <?php selected( $widget_galleries_count_display, 2 ); ?>>2</option>
295
+ <option <?php selected( $widget_galleries_count_display, 4 ); ?>>4</option>
296
+ <option <?php selected( $widget_galleries_count_display, 6 ); ?>>6</option>
297
+ <option <?php selected( $widget_galleries_count_display, 8 ); ?>>8</option>
298
+ <option <?php selected( $widget_galleries_count_display, 10 ); ?>>10</option>
299
+ <option <?php selected( $widget_galleries_count_display, 12 ); ?>>12</option>
300
+ </select>
301
+ </label>
302
+ </p>
303
+ <p>
304
+ <label for="<?php echo $this->get_field_id( 'widget_galleries_hover_color' ); ?>">
305
+ <?php _e( 'Gallery Hover Color', 'gallery-plugin' ); ?>:</label>
306
+ <input class="widefat gllr-hover-color" id="<?php echo $this->get_field_id( 'widget_galleries_hover_color' ); ?>"
307
+ name="<?php echo $this->get_field_name( 'widget_galleries_hover_color' ); ?>" type="text"
308
+ value="<?php echo esc_attr( $widget_galleries_hover_color ); ?>",
309
+ data-default-color="#F1F1F1"/>
310
+ </p>
311
+ <script type='text/javascript'>
312
+ jQuery( document ).ready(function($) {
313
+ var params = {
314
+ change: function(e, ui) {
315
+ $( e.target ).val( ui.color.toString() );
316
+ $( e.target ).trigger( 'change' ); // enable widget "Save" button
317
+ },
318
+ }
319
+ $( '.gllr-hover-color' ).wpColorPicker( params );
320
+ });
321
+ </script>
322
+ <noscript>
323
+ <p>
324
+ <?php _e( 'Please, enable JavaScript in Your browser.', 'gallery-plugin' ); ?>
325
+ </p>
326
+ </noscript>
327
+ <?php }
328
+ }
329
+ }
330
+
331
+ /**
332
+ * Function generate position and sizes for cells in collage
333
+ *
334
+ * @param int $count_galleries count galleries with button
335
+ * @param int $count_column count columns in grid
336
+ * @param int $count_row count rows in grid
337
+ *
338
+ * @return array() $cell_properties array with classes and coordinates for cells
339
+ */
340
+ if ( ! function_exists( 'gllr_generate_collage_template' ) ) {
341
+ function gllr_generate_collage_template( $count_galleries, $count_column, $count_row ) {
342
+ $count_empty_cell = $count_column * $count_row - $count_galleries;
343
+ $count_large_cell = $count_medium_cell = 0;
344
+ $image_number = 1;
345
+
346
+ if ( $count_empty_cell < 3 ) {
347
+ $count_medium_cell = $count_empty_cell + $image_number;
348
+ $count_large_cell = $image_number;
349
+ } else if ( 0 != $count_empty_cell % 3 ) {
350
+ $count_large_cell = floor( $count_empty_cell / 3 ) + $image_number;
351
+ $count_medium_cell = $count_empty_cell % 3 + $count_large_cell;
352
+ } else {
353
+ $count_large_cell = $count_empty_cell / 3 + $image_number;
354
+ }
355
+
356
+ /* Create empty template. Zero is empty cell */
357
+ $collage_template = array();
358
+ for ( $i = 0; $i < $count_row; $i ++ ) {
359
+ for ( $j = 0; $j < $count_column; $j ++ ) {
360
+ $collage_template[ $i ][ $j ] = 0;
361
+ }
362
+ }
363
+
364
+ /* Random Insert large cells */
365
+ while ( $count_large_cell > $image_number ) {
366
+ $i = rand( 0, $count_row - 2 );
367
+ $j = rand( 0, $count_column - 2 );
368
+
369
+ if ( 0 == $collage_template[ $i ][ $j ] && 0 == $collage_template[ $i + 1 ][ $j ] && 0 == $collage_template[ $i ][ $j + 1 ] && 0 == $collage_template[ $i + 1 ][ $j + 1 ] ) {
370
+ $collage_template[ $i ][ $j ] = $collage_template[ $i + 1 ][ $j ] = $collage_template[ $i ][ $j + 1 ] = $collage_template[ $i + 1 ][ $j + 1 ] = $image_number;
371
+ $cell_properties[ $image_number ]['class'] = 'gllr-widget-large-cell';
372
+ $cell_properties[ $image_number ]['x'] = $j + 1;
373
+ $cell_properties[ $image_number ]['y'] = $i + 1;
374
+ $image_number ++;
375
+ }
376
+ }
377
+
378
+ /* Random Insert wide and tall cells */
379
+ while ( $count_medium_cell > $image_number ) {
380
+ $i = rand( 0, $count_row - 2 );
381
+ $j = rand( 0, $count_column - 2 );
382
+
383
+ if ( 0 == $collage_template[ $i ][ $j ] ) {
384
+ switch ( rand( 0, 1 ) ) {
385
+ case 0:
386
+ if ( 0 == $collage_template[ $i + 1 ][ $j ] ) {
387
+ $collage_template[ $i ][ $j ] = $collage_template[ $i + 1 ][ $j ] = $image_number;
388
+ $cell_properties[ $image_number ]['class'] = 'gllr-widget-tall-cell';
389
+ $cell_properties[ $image_number ]['x'] = $j + 1;
390
+ $cell_properties[ $image_number ]['y'] = $i + 1;
391
+ $image_number ++;
392
+ }
393
+ break;
394
+ case 1:
395
+ if ( 0 == $collage_template[ $i ][ $j + 1 ] ) {
396
+ $collage_template[ $i ][ $j ] = $collage_template[ $i ][ $j + 1 ] = $image_number;
397
+ $cell_properties[ $image_number ]['class'] = 'gllr-widget-wide-cell';
398
+ $cell_properties[ $image_number ]['x'] = $j + 1;
399
+ $cell_properties[ $image_number ]['y'] = $i + 1;
400
+ $image_number ++;
401
+ }
402
+ break;
403
+ }
404
+ }
405
+
406
+ if ( $count_medium_cell == $image_number ) {
407
+ break;
408
+ }
409
+
410
+ $i = rand( 1, $count_row - 1 );
411
+ $j = rand( 1, $count_column - 1 );
412
+
413
+ if ( 0 == $collage_template[ $i ][ $j ] ) {
414
+ switch ( rand( 0, 1 ) ) {
415
+ case 0:
416
+ if ( 0 == $collage_template[ $i - 1 ][ $j ] ) {
417
+ $collage_template[ $i ][ $j ] = $collage_template[ $i - 1 ][ $j ] = $image_number;
418
+ $cell_properties[ $image_number ]['class'] = 'gllr-widget-tall-cell';
419
+ $cell_properties[ $image_number ]['x'] = $j + 1;
420
+ $cell_properties[ $image_number ]['y'] = $i;
421
+ $image_number ++;
422
+ }
423
+ break;
424
+ case 1:
425
+ if ( 0 == $collage_template[ $i ][ $j - 1 ] ) {
426
+ $collage_template[ $i ][ $j ] = $collage_template[ $i ][ $j - 1 ] = $image_number;
427
+ $cell_properties[ $image_number ]['class'] = 'gllr-widget-wide-cell';
428
+ $cell_properties[ $image_number ]['x'] = $j;
429
+ $cell_properties[ $image_number ]['y'] = $i + 1;
430
+ $image_number ++;
431
+ }
432
+ break;
433
+ }
434
+ }
435
+ }
436
+
437
+ /* Insert small cells */
438
+ for ( $i = 0; $i < $count_row; $i ++ ) {
439
+ for ( $j = 0; $j < $count_column; $j ++ ) {
440
+ if ( 0 == $collage_template[ $i ][ $j ] ) {
441
+ $collage_template[ $i ][ $j ] = $image_number;
442
+ $cell_properties[ $image_number ]['class'] = '';
443
+ $cell_properties[ $image_number ]['x'] = $j + 1;
444
+ $cell_properties[ $image_number ]['y'] = $i + 1;
445
+ $image_number ++;
446
+ }
447
+ }
448
+ }
449
+
450
+ return $cell_properties;
451
+ }
452
+ }
453
+
454
+ add_action( 'widgets_init', 'gllr_register_widget' );
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: bestwebsoft
3
  Donate link: https://bestwebsoft.com/donate/
4
  Tags: add album, add galleries, add images, add pictures, add albums, gallery, gallery plugin, gallery slider, fancy gallery, slideshow, lightbox, fullscreen gallery
5
  Requires at least: 4.0
6
- Tested up to: 5.2.1
7
- Stable tag: 4.6.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -227,6 +227,9 @@ Please make sure that the problem hasn't been discussed yet on our forum (<https
227
 
228
  == Changelog ==
229
 
 
 
 
230
  = V4.6.2 - 17.06.2019 =
231
  * Bugfix : Compatibility with Pagination by BestWebSoft has been fixed.
232
  * Update : The Chinese language file has been updated.
@@ -674,6 +677,9 @@ Please make sure that the problem hasn't been discussed yet on our forum (<https
674
 
675
  == Upgrade Notice ==
676
 
 
 
 
677
  = V4.6.2 =
678
  * Bugs fixed.
679
  * Languages updated.
3
  Donate link: https://bestwebsoft.com/donate/
4
  Tags: add album, add galleries, add images, add pictures, add albums, gallery, gallery plugin, gallery slider, fancy gallery, slideshow, lightbox, fullscreen gallery
5
  Requires at least: 4.0
6
+ Tested up to: 5.2.2
7
+ Stable tag: 4.6.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
227
 
228
  == Changelog ==
229
 
230
+ = V4.6.3 - 04.09.2019 =
231
+ * Update: The deactivation feedback has been changed. Misleading buttons have been removed.
232
+
233
  = V4.6.2 - 17.06.2019 =
234
  * Bugfix : Compatibility with Pagination by BestWebSoft has been fixed.
235
  * Update : The Chinese language file has been updated.
677
 
678
  == Upgrade Notice ==
679
 
680
+ = V4.6.3 =
681
+ * Usability improved
682
+
683
  = V4.6.2 =
684
  * Bugs fixed.
685
  * Languages updated.
screenshot-10.png ADDED
Binary file
screenshot-11.png ADDED
Binary file