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

170 lines 5.8 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.6.5
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.6.5' );
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__ ) . '/vendor/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 ),
79 'is_live' => true,
80 ) );
81 }
82 return $ayg_fs;
83 }
84
85 // Init Freemius
86 ayg_fs();
87 // Signal that SDK was initiated
88 do_action( 'ayg_fs_loaded' );
89 }
90 if ( !function_exists( 'activate_ayg' ) ) {
91 /**
92 * The code that runs during plugin activation.
93 * This action is documented in includes/activator.php
94 */
95 function activate_ayg( $network_wide ) {
96 if ( is_multisite() && $network_wide ) {
97 deactivate_plugins( AYG_FILE_NAME );
98 wp_die( __( 'Sorry, this plugin cannot be activated network-wide. Please activate it individually on each site where it is needed.', 'automatic-youtube-gallery' ), __( 'Network Activation Not Allowed', 'automatic-youtube-gallery' ), array(
99 'back_link' => true,
100 ) );
101 }
102 require_once AYG_DIR . 'includes/activator.php';
103 AYG_Activator::activate();
104 }
105
106 register_activation_hook( __FILE__, 'activate_ayg' );
107 }
108 if ( !function_exists( 'deactivate_ayg' ) ) {
109 /**
110 * The code that runs during plugin deactivation.
111 * This action is documented in includes/deactivator.php
112 */
113 function deactivate_ayg() {
114 require_once AYG_DIR . 'includes/deactivator.php';
115 AYG_Deactivator::deactivate();
116 }
117
118 register_deactivation_hook( __FILE__, 'deactivate_ayg' );
119 }
120 if ( !function_exists( 'run_ayg' ) ) {
121 /**
122 * Begins execution of the plugin.
123 *
124 * Since everything within the plugin is registered via hooks,
125 * then kicking off the plugin from this point in the file does
126 * not affect the page life cycle.
127 *
128 * @since 1.0.0
129 */
130 function run_ayg() {
131 require_once AYG_DIR . 'includes/init.php';
132 $plugin = new AYG_Init();
133 $plugin->run();
134 }
135
136 run_ayg();
137 }
138 if ( !function_exists( 'ayg_fs_uninstall_cleanup' ) ) {
139 /**
140 * Plugin uninstall cleanup.
141 *
142 * @since 1.0.0
143 */
144 function ayg_fs_uninstall_cleanup() {
145 global $wpdb;
146 // Delete all the plugin transients
147 $transient_keys = get_option( 'ayg_transient_keys', array() );
148 foreach ( $transient_keys as $key ) {
149 delete_transient( $key );
150 }
151 // Delete all the plugin options
152 delete_option( 'ayg_general_settings' );
153 delete_option( 'ayg_strings_settings' );
154 delete_option( 'ayg_gallery_settings' );
155 delete_option( 'ayg_player_settings' );
156 delete_option( 'ayg_livestream_settings' );
157 delete_option( 'ayg_seo_settings' );
158 delete_option( 'ayg_privacy_settings' );
159 delete_option( 'ayg_gallery_page_ids' );
160 delete_option( 'ayg_channel_ids' );
161 delete_option( 'ayg_playlist_ids' );
162 delete_option( 'ayg_transient_keys' );
163 delete_option( 'ayg_version' );
164 // Delete our custom database tables
165 $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}ayg_videos" );
166 $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}ayg_galleries" );
167 }
168
169 ayg_fs()->add_action( 'after_uninstall', 'ayg_fs_uninstall_cleanup' );
170 }