All-in-One Video Gallery - Version 1.5.8

Version Description

  • Fix: Fixes a SERIOUS BUG. Pages created infinitely in some websites.
Download this release

Release Info

Developer plugins360
Plugin Icon 128x128 All-in-One Video Gallery
Version 1.5.8
Comparing to
See all releases

Code changes from version 1.5.7 to 1.5.8

README.txt CHANGED
@@ -6,7 +6,7 @@ Tags: player, youtube, vimeo, live, stream
6
  Requires at least: 4.4.0
7
  Tested up to: 5.0
8
  Requires PHP: 5.3.0
9
- Stable tag: 1.5.7
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -91,6 +91,10 @@ Most likely rewrite rules were not registered properly for some reason. Go to "W
91
 
92
  == Changelog ==
93
 
 
 
 
 
94
  = 1.5.7 =
95
 
96
  * New: Freemius Integration.
@@ -159,6 +163,10 @@ Most likely rewrite rules were not registered properly for some reason. Go to "W
159
 
160
  == Upgrade Notice ==
161
 
 
 
 
 
162
  = 1.5.7 =
163
 
164
  * New: Freemius Integration.
6
  Requires at least: 4.4.0
7
  Tested up to: 5.0
8
  Requires PHP: 5.3.0
9
+ Stable tag: 1.5.8
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
91
 
92
  == Changelog ==
93
 
94
+ = 1.5.8 =
95
+
96
+ * Fix: Fixes a SERIOUS BUG. Pages created infinitely in some websites.
97
+
98
  = 1.5.7 =
99
 
100
  * New: Freemius Integration.
163
 
164
  == Upgrade Notice ==
165
 
166
+ = 1.5.8 =
167
+
168
+ * Fix: Fixes a SERIOUS BUG. Pages created infinitely in some websites.
169
+
170
  = 1.5.7 =
171
 
172
  * New: Freemius Integration.
admin/admin.php CHANGED
@@ -26,64 +26,64 @@ class AIOVG_Admin {
26
  *
27
  * @since 1.5.2
28
  */
29
- public function wp_loaded() {
30
- $defaults = aiovg_get_default_settings();
 
 
 
 
31
 
32
- // Insert the missing player settings
33
- $player_settings = get_option( 'aiovg_player_settings' );
34
 
35
- $new_player_settings = array();
36
 
37
- if ( ! array_key_exists( 'use_native_controls', $player_settings ) ) {
38
- $new_player_settings['use_native_controls'] = $defaults['aiovg_player_settings']['use_native_controls'];
39
- }
40
 
41
- if ( count( $new_player_settings ) ) {
42
- update_option( 'aiovg_player_settings', array_merge( $player_settings, $new_player_settings ) );
43
- }
44
-
45
- // Insert the missing categories settings
46
- $categories_settings = get_option( 'aiovg_categories_settings' );
47
 
48
- $new_categories_settings = array();
49
 
50
- if ( ! array_key_exists( 'template', $categories_settings ) ) {
51
- $new_categories_settings['template'] = $defaults['aiovg_categories_settings']['template'];
52
- }
53
 
54
- if ( ! array_key_exists( 'hierarchical', $categories_settings ) ) {
55
- $new_categories_settings['hierarchical'] = $defaults['aiovg_categories_settings']['hierarchical'];
56
- }
57
 
58
- if ( count( $new_categories_settings ) ) {
59
- update_option( 'aiovg_categories_settings', array_merge( $categories_settings, $new_categories_settings ) );
60
- }
61
 
62
- // Insert the missing videos settings
63
- $videos_settings = get_option( 'aiovg_videos_settings' );
64
 
65
- $new_videos_settings = array();
66
 
67
- if ( ! array_key_exists( 'template', $videos_settings ) ) {
68
- $new_videos_settings['template'] = $defaults['aiovg_videos_settings']['template'];
69
- }
70
 
71
- if ( ! array_key_exists( 'thumbnail_style', $videos_settings ) ) {
72
- $new_videos_settings['thumbnail_style'] = $defaults['aiovg_videos_settings']['thumbnail_style'];
73
- }
74
 
75
- if ( count( $new_videos_settings ) ) {
76
- update_option( 'aiovg_videos_settings', array_merge( $videos_settings, $new_videos_settings ) );
77
- }
78
-
79
- // Insert the privacy settings
80
- if ( false == get_option( 'aiovg_privacy_settings' ) ) {
81
- add_option( 'aiovg_privacy_settings', $defaults['aiovg_privacy_settings'] );
82
- }
83
 
84
- // Update the plugin version
85
- if ( AIOVG_PLUGIN_VERSION !== get_option( 'aiovg_version' ) ) {
86
- update_option( 'aiovg_version', AIOVG_PLUGIN_VERSION );
 
87
  }
88
  }
89
 
26
  *
27
  * @since 1.5.2
28
  */
29
+ public function wp_loaded() {
30
+ if ( AIOVG_PLUGIN_VERSION !== get_option( 'aiovg_version' ) ) {
31
+ $defaults = aiovg_get_default_settings();
32
+
33
+ // Update the plugin version
34
+ update_option( 'aiovg_version', AIOVG_PLUGIN_VERSION );
35
 
36
+ // Insert the missing player settings
37
+ $player_settings = get_option( 'aiovg_player_settings' );
38
 
39
+ $new_player_settings = array();
40
 
41
+ if ( ! array_key_exists( 'use_native_controls', $player_settings ) ) {
42
+ $new_player_settings['use_native_controls'] = $defaults['aiovg_player_settings']['use_native_controls'];
43
+ }
44
 
45
+ if ( count( $new_player_settings ) ) {
46
+ update_option( 'aiovg_player_settings', array_merge( $player_settings, $new_player_settings ) );
47
+ }
48
+
49
+ // Insert the missing categories settings
50
+ $categories_settings = get_option( 'aiovg_categories_settings' );
51
 
52
+ $new_categories_settings = array();
53
 
54
+ if ( ! array_key_exists( 'template', $categories_settings ) ) {
55
+ $new_categories_settings['template'] = $defaults['aiovg_categories_settings']['template'];
56
+ }
57
 
58
+ if ( ! array_key_exists( 'hierarchical', $categories_settings ) ) {
59
+ $new_categories_settings['hierarchical'] = $defaults['aiovg_categories_settings']['hierarchical'];
60
+ }
61
 
62
+ if ( count( $new_categories_settings ) ) {
63
+ update_option( 'aiovg_categories_settings', array_merge( $categories_settings, $new_categories_settings ) );
64
+ }
65
 
66
+ // Insert the missing videos settings
67
+ $videos_settings = get_option( 'aiovg_videos_settings' );
68
 
69
+ $new_videos_settings = array();
70
 
71
+ if ( ! array_key_exists( 'template', $videos_settings ) ) {
72
+ $new_videos_settings['template'] = $defaults['aiovg_videos_settings']['template'];
73
+ }
74
 
75
+ if ( ! array_key_exists( 'thumbnail_style', $videos_settings ) ) {
76
+ $new_videos_settings['thumbnail_style'] = $defaults['aiovg_videos_settings']['thumbnail_style'];
77
+ }
78
 
79
+ if ( count( $new_videos_settings ) ) {
80
+ update_option( 'aiovg_videos_settings', array_merge( $videos_settings, $new_videos_settings ) );
81
+ }
 
 
 
 
 
82
 
83
+ // Insert the privacy settings
84
+ if ( false == get_option( 'aiovg_privacy_settings' ) ) {
85
+ add_option( 'aiovg_privacy_settings', $defaults['aiovg_privacy_settings'] );
86
+ }
87
  }
88
  }
89
 
all-in-one-video-gallery.php CHANGED
@@ -11,7 +11,7 @@
11
  * Plugin Name: All-in-One Video Gallery
12
  * Plugin URI: https://plugins360.com/all-in-one-video-gallery/
13
  * Description: No coding required. A Responsive & Lightweight video gallery plugin. HTML5 Video Player, Custom Post Type interface, Categories, Visual Gallery Builder (Gutenberg), forms to Search Videos, Social Sharing and everything you will need to build a YouTube/Vimeo like video sharing website.
14
- * Version: 1.5.7
15
  * Author: Team Plugins360
16
  * Author URI: https://plugins360.com
17
  * License: GPL-2.0+
@@ -76,7 +76,7 @@ if ( !function_exists( 'aiovg_fs' ) ) {
76
 
77
  // The current version of the plugin
78
  if ( !defined( 'AIOVG_PLUGIN_VERSION' ) ) {
79
- define( 'AIOVG_PLUGIN_VERSION', '1.5.7' );
80
  }
81
  // The unique identifier of the plugin
82
  if ( !defined( 'AIOVG_PLUGIN_SLUG' ) ) {
11
  * Plugin Name: All-in-One Video Gallery
12
  * Plugin URI: https://plugins360.com/all-in-one-video-gallery/
13
  * Description: No coding required. A Responsive & Lightweight video gallery plugin. HTML5 Video Player, Custom Post Type interface, Categories, Visual Gallery Builder (Gutenberg), forms to Search Videos, Social Sharing and everything you will need to build a YouTube/Vimeo like video sharing website.
14
+ * Version: 1.5.8
15
  * Author: Team Plugins360
16
  * Author URI: https://plugins360.com
17
  * License: GPL-2.0+
76
 
77
  // The current version of the plugin
78
  if ( !defined( 'AIOVG_PLUGIN_VERSION' ) ) {
79
+ define( 'AIOVG_PLUGIN_VERSION', '1.5.8' );
80
  }
81
  // The unique identifier of the plugin
82
  if ( !defined( 'AIOVG_PLUGIN_SLUG' ) ) {
includes/functions.php CHANGED
@@ -1406,38 +1406,30 @@ function aiovg_insert_array_after( $key, $array, $new_array ) {
1406
  */
1407
  function aiovg_insert_custom_pages() {
1408
  // Vars
1409
- $page_settings = get_option( 'aiovg_page_settings', array() );
1410
-
1411
- $page_definitions = array(
1412
- 'category' => array(
1413
- 'title' => __( 'Video Category', 'all-in-one-video-gallery' ),
1414
- 'content' => '[aiovg_category]'
1415
- ),
1416
- 'search' => array(
1417
- 'title' => __( 'Search Videos', 'all-in-one-video-gallery' ),
1418
- 'content' => '[aiovg_search]'
1419
- ),
1420
- 'user_videos' => array(
1421
- 'title' => __( 'User Videos', 'all-in-one-video-gallery' ),
1422
- 'content' => '[aiovg_user_videos]'
1423
- ),
1424
- 'player' => array(
1425
- 'title' => __( 'Player Embed', 'all-in-one-video-gallery' ),
1426
- 'content' => ''
1427
- )
1428
- );
1429
-
1430
- // ...
1431
- $pages = array();
1432
-
1433
- foreach ( $page_definitions as $slug => $page ) {
1434
- $id = 0;
1435
 
1436
- if ( array_key_exists( $slug, $page_settings ) ) {
1437
- $id = (int) $page_settings[ $slug ];
1438
- }
1439
-
1440
- if ( ! $id ) {
1441
  $id = wp_insert_post(
1442
  array(
1443
  'post_title' => $page['title'],
@@ -1448,9 +1440,11 @@ function aiovg_insert_custom_pages() {
1448
  'comment_status' => 'closed'
1449
  )
1450
  );
1451
- }
1452
-
1453
- $pages[ $slug ] = $id;
 
 
1454
  }
1455
 
1456
  return $pages;
1406
  */
1407
  function aiovg_insert_custom_pages() {
1408
  // Vars
1409
+ if ( false == get_option( 'aiovg_page_settings' ) ) {
1410
+ $page_definitions = array(
1411
+ 'category' => array(
1412
+ 'title' => __( 'Video Category', 'all-in-one-video-gallery' ),
1413
+ 'content' => '[aiovg_category]'
1414
+ ),
1415
+ 'search' => array(
1416
+ 'title' => __( 'Search Videos', 'all-in-one-video-gallery' ),
1417
+ 'content' => '[aiovg_search]'
1418
+ ),
1419
+ 'user_videos' => array(
1420
+ 'title' => __( 'User Videos', 'all-in-one-video-gallery' ),
1421
+ 'content' => '[aiovg_user_videos]'
1422
+ ),
1423
+ 'player' => array(
1424
+ 'title' => __( 'Player Embed', 'all-in-one-video-gallery' ),
1425
+ 'content' => ''
1426
+ )
1427
+ );
 
 
 
 
 
 
 
1428
 
1429
+ // ...
1430
+ $pages = array();
1431
+
1432
+ foreach ( $page_definitions as $slug => $page ) {
 
1433
  $id = wp_insert_post(
1434
  array(
1435
  'post_title' => $page['title'],
1440
  'comment_status' => 'closed'
1441
  )
1442
  );
1443
+
1444
+ $pages[ $slug ] = $id;
1445
+ }
1446
+ } else {
1447
+ $pages = get_option( 'aiovg_page_settings' );
1448
  }
1449
 
1450
  return $pages;