PluginProbe
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels / 2.2.0
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels v2.2.0
2.9.1 2.9.0 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 2.0.0 2.1.0 2.2.0 2.3.2 2.3.3 2.3.5 2.3.6 2.3.8 2.3.9 2.4.3 All 37 releases
automatic-youtube-gallery / automatic-youtube-gallery.php

automatic-youtube-gallery.php in Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels 2.2.0, at automatic-youtube-gallery.php

180 lines 5.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * The plugin bootstrap file
5 *
6 * @link https://plugins360.com
7 * @since 1.0.0
8 * @package Automatic_YouTube_Gallery
9 *
10 * @wordpress-plugin
11 * Plugin Name: Automatic YouTube Gallery
12 * Plugin URI: https://plugins360.com/automatic-youtube-gallery/
13 * Description: Create responsive, modern & dynamic video galleries by simply adding a YouTube USERNAME, CHANNEL, PLAYLIST, SEARCH TERM, or a custom list of YouTube URLs.
14 * Version: 2.2.0
15 * Author: Team Plugins360
16 * Author URI: https://plugins360.com
17 * License: GPL-2.0+
18 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
19 * Text Domain: automatic-youtube-gallery
20 * Domain Path: /languages
21 *
22 */
23 // Exit if accessed directly
24 if ( !defined( 'WPINC' ) ) {
25 die;
26 }
27
28 if ( function_exists( 'ayg_fs' ) ) {
29 ayg_fs()->set_basename( false, __FILE__ );
30 return;
31 }
32
33 // Current version of the plugin
34 if ( !defined( 'AYG_VERSION' ) ) {
35 define( 'AYG_VERSION', '2.2.0' );
36 }
37 // Unique identifier of the plugin
38 if ( !defined( 'AYG_SLUG' ) ) {
39 define( 'AYG_SLUG', 'automatic-youtube-gallery' );
40 }
41 // Path to the plugin directory
42 if ( !defined( 'AYG_DIR' ) ) {
43 define( 'AYG_DIR', plugin_dir_path( __FILE__ ) );
44 }
45 // URL of the plugin
46 if ( !defined( 'AYG_URL' ) ) {
47 define( 'AYG_URL', plugin_dir_url( __FILE__ ) );
48 }
49 // The plugin file name
50 if ( !defined( 'AYG_FILE_NAME' ) ) {
51 define( 'AYG_FILE_NAME', plugin_basename( __FILE__ ) );
52 }
53
54 if ( !function_exists( 'ayg_fs' ) ) {
55 // Create a helper function for easy SDK access
56 function ayg_fs()
57 {
58 global $ayg_fs ;
59
60 if ( !isset( $ayg_fs ) ) {
61 // Activate multisite network integration
62 if ( !defined( 'WP_FS__PRODUCT_2922_MULTISITE' ) ) {
63 define( 'WP_FS__PRODUCT_2922_MULTISITE', true );
64 }
65 // Include Freemius SDK
66 require_once dirname( __FILE__ ) . '/freemius/start.php';
67 $ayg_fs = fs_dynamic_init( array(
68 'id' => '2922',
69 'slug' => 'automatic-youtube-gallery',
70 'type' => 'plugin',
71 'public_key' => 'pk_7734619fa98d4e2b76a390a890739',
72 'is_premium' => false,
73 'premium_suffix' => 'Premium',
74 'has_addons' => false,
75 'has_paid_plans' => true,
76 'trial' => array(
77 'days' => 7,
78 'is_require_payment' => false,
79 ),
80 'menu' => array(
81 'slug' => 'automatic-youtube-gallery',
82 'first-path' => 'admin.php?page=automatic-youtube-gallery',
83 'support' => false,
84 ),
85 'is_live' => true,
86 ) );
87 }
88
89 return $ayg_fs;
90 }
91
92 // Init Freemius
93 ayg_fs();
94 // Signal that SDK was initiated
95 do_action( 'ayg_fs_loaded' );
96 }
97
98
99 if ( !function_exists( 'activate_ayg' ) ) {
100 /**
101 * The code that runs during plugin activation.
102 * This action is documented in includes/activator.php
103 */
104 function activate_ayg()
105 {
106 require_once AYG_DIR . 'includes/activator.php';
107 AYG_Activator::activate();
108 }
109
110 register_activation_hook( __FILE__, 'activate_ayg' );
111 }
112
113
114 if ( !function_exists( 'deactivate_ayg' ) ) {
115 /**
116 * The code that runs during plugin deactivation.
117 * This action is documented in includes/deactivator.php
118 */
119 function deactivate_ayg()
120 {
121 require_once AYG_DIR . 'includes/deactivator.php';
122 AYG_Deactivator::deactivate();
123 }
124
125 register_deactivation_hook( __FILE__, 'deactivate_ayg' );
126 }
127
128
129 if ( !function_exists( 'run_ayg' ) ) {
130 /**
131 * Begins execution of the plugin.
132 *
133 * Since everything within the plugin is registered via hooks,
134 * then kicking off the plugin from this point in the file does
135 * not affect the page life cycle.
136 *
137 * @since 1.0.0
138 */
139 function run_ayg()
140 {
141 require_once AYG_DIR . 'includes/init.php';
142 $plugin = new AYG_Init();
143 $plugin->run();
144 }
145
146 run_ayg();
147 }
148
149
150 if ( !function_exists( 'ayg_fs_uninstall_cleanup' ) ) {
151 /**
152 * Plugin uninstall cleanup.
153 *
154 * @since 1.0.0
155 */
156 function ayg_fs_uninstall_cleanup()
157 {
158 global $wpdb ;
159 // Delete all the plugin transients
160 $transient_keys = get_option( 'ayg_transient_keys', array() );
161 foreach ( $transient_keys as $key ) {
162 delete_transient( $key );
163 }
164 // Delete all the plugin options
165 delete_option( 'ayg_general_settings' );
166 delete_option( 'ayg_gallery_settings' );
167 delete_option( 'ayg_player_settings' );
168 delete_option( 'ayg_livestream_settings' );
169 delete_option( 'ayg_seo_settings' );
170 delete_option( 'ayg_privacy_settings' );
171 delete_option( 'ayg_gallery_page_ids' );
172 delete_option( 'ayg_transient_keys' );
173 delete_option( 'ayg_version' );
174 // Delete our custom database table "{$wpdb->prefix}ayg_videos"
175 $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}ayg_videos" );
176 }
177
178 ayg_fs()->add_action( 'after_uninstall', 'ayg_fs_uninstall_cleanup' );
179 }
180