PluginProbe
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels / 2.4.3
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels v2.4.3
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.4.3, at automatic-youtube-gallery.php

163 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 KEYWORDS, or a custom list of YouTube URLs.
14 * Version: 2.4.3
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 if ( function_exists( 'ayg_fs' ) ) {
28 ayg_fs()->set_basename( false, __FILE__ );
29 return;
30 }
31 // Current version of the plugin
32 if ( !defined( 'AYG_VERSION' ) ) {
33 define( 'AYG_VERSION', '2.4.3' );
34 }
35 // Unique identifier of the plugin
36 if ( !defined( 'AYG_SLUG' ) ) {
37 define( 'AYG_SLUG', 'automatic-youtube-gallery' );
38 }
39 // Path to the plugin directory
40 if ( !defined( 'AYG_DIR' ) ) {
41 define( 'AYG_DIR', plugin_dir_path( __FILE__ ) );
42 }
43 // URL of the plugin
44 if ( !defined( 'AYG_URL' ) ) {
45 define( 'AYG_URL', plugin_dir_url( __FILE__ ) );
46 }
47 // The plugin file name
48 if ( !defined( 'AYG_FILE_NAME' ) ) {
49 define( 'AYG_FILE_NAME', plugin_basename( __FILE__ ) );
50 }
51 if ( !function_exists( 'ayg_fs' ) ) {
52 // Create a helper function for easy SDK access
53 function ayg_fs() {
54 global $ayg_fs;
55 if ( !isset( $ayg_fs ) ) {
56 // Activate multisite network integration
57 if ( !defined( 'WP_FS__PRODUCT_2922_MULTISITE' ) ) {
58 define( 'WP_FS__PRODUCT_2922_MULTISITE', true );
59 }
60 // Include Freemius SDK
61 require_once dirname( __FILE__ ) . '/freemius/start.php';
62 $ayg_fs = fs_dynamic_init( array(
63 'id' => '2922',
64 'slug' => 'automatic-youtube-gallery',
65 'type' => 'plugin',
66 'public_key' => 'pk_7734619fa98d4e2b76a390a890739',
67 'is_premium' => false,
68 'premium_suffix' => 'Premium',
69 'has_addons' => false,
70 'has_paid_plans' => true,
71 'trial' => array(
72 'days' => 7,
73 'is_require_payment' => false,
74 ),
75 'menu' => array(
76 'slug' => 'automatic-youtube-gallery',
77 'first-path' => 'admin.php?page=automatic-youtube-gallery',
78 'support' => false,
79 ),
80 'is_live' => true,
81 ) );
82 }
83 return $ayg_fs;
84 }
85
86 // Init Freemius
87 ayg_fs();
88 // Signal that SDK was initiated
89 do_action( 'ayg_fs_loaded' );
90 }
91 if ( !function_exists( 'activate_ayg' ) ) {
92 /**
93 * The code that runs during plugin activation.
94 * This action is documented in includes/activator.php
95 */
96 function activate_ayg() {
97 require_once AYG_DIR . 'includes/activator.php';
98 AYG_Activator::activate();
99 }
100
101 register_activation_hook( __FILE__, 'activate_ayg' );
102 }
103 if ( !function_exists( 'deactivate_ayg' ) ) {
104 /**
105 * The code that runs during plugin deactivation.
106 * This action is documented in includes/deactivator.php
107 */
108 function deactivate_ayg() {
109 require_once AYG_DIR . 'includes/deactivator.php';
110 AYG_Deactivator::deactivate();
111 }
112
113 register_deactivation_hook( __FILE__, 'deactivate_ayg' );
114 }
115 if ( !function_exists( 'run_ayg' ) ) {
116 /**
117 * Begins execution of the plugin.
118 *
119 * Since everything within the plugin is registered via hooks,
120 * then kicking off the plugin from this point in the file does
121 * not affect the page life cycle.
122 *
123 * @since 1.0.0
124 */
125 function run_ayg() {
126 require_once AYG_DIR . 'includes/init.php';
127 $plugin = new AYG_Init();
128 $plugin->run();
129 }
130
131 run_ayg();
132 }
133 if ( !function_exists( 'ayg_fs_uninstall_cleanup' ) ) {
134 /**
135 * Plugin uninstall cleanup.
136 *
137 * @since 1.0.0
138 */
139 function ayg_fs_uninstall_cleanup() {
140 global $wpdb;
141 // Delete all the plugin transients
142 $transient_keys = get_option( 'ayg_transient_keys', array() );
143 foreach ( $transient_keys as $key ) {
144 delete_transient( $key );
145 }
146 // Delete all the plugin options
147 delete_option( 'ayg_general_settings' );
148 delete_option( 'ayg_gallery_settings' );
149 delete_option( 'ayg_player_settings' );
150 delete_option( 'ayg_livestream_settings' );
151 delete_option( 'ayg_seo_settings' );
152 delete_option( 'ayg_privacy_settings' );
153 delete_option( 'ayg_gallery_page_ids' );
154 delete_option( 'ayg_channel_ids' );
155 delete_option( 'ayg_playlist_ids' );
156 delete_option( 'ayg_transient_keys' );
157 delete_option( 'ayg_version' );
158 // Delete our custom database table "{$wpdb->prefix}ayg_videos"
159 $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}ayg_videos" );
160 }
161
162 ayg_fs()->add_action( 'after_uninstall', 'ayg_fs_uninstall_cleanup' );
163 }