| @@ -9,10 +9,10 @@ | ||
| 9 | 9 | * |
| 10 | 10 | * @wordpress-plugin |
| 11 | 11 | * Plugin Name: Automatic YouTube Gallery |
| 12 | 12 | * Plugin URI: https://plugins360.com/automatic-youtube-gallery/ |
| 13 | - * Description: Embed YouTube videos, playlists, channels, live streams & Shorts in a responsive video gallery that stays up to date automatically. | |
| 14 | - * Version: 2.9.1 | |
| 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.3.8 | |
| 15 | 15 | * Author: Team Plugins360 |
| 16 | 16 | * Author URI: https://plugins360.com |
| 17 | 17 | * License: GPL-2.0+ |
| 18 | 18 | * License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| @@ -23,15 +23,17 @@ | ||
| 23 | 23 | // Exit if accessed directly |
| 24 | 24 | if ( !defined( 'WPINC' ) ) { |
| 25 | 25 | die; |
| 26 | 26 | } |
| 27 | + | |
| 27 | 28 | if ( function_exists( 'ayg_fs' ) ) { |
| 28 | 29 | ayg_fs()->set_basename( false, __FILE__ ); |
| 29 | 30 | return; |
| 30 | 31 | } |
| 32 | + | |
| 31 | 33 | // Current version of the plugin |
| 32 | 34 | if ( !defined( 'AYG_VERSION' ) ) { |
| 33 | - define( 'AYG_VERSION', '2.9.1' ); | |
| 35 | + define( 'AYG_VERSION', '2.3.8' ); | |
| 34 | 36 | } |
| 35 | 37 | // Unique identifier of the plugin |
| 36 | 38 | if ( !defined( 'AYG_SLUG' ) ) { |
| 37 | 39 | define( 'AYG_SLUG', 'automatic-youtube-gallery' ); |
| @@ -47,12 +49,15 @@ | ||
| 47 | 49 | // The plugin file name |
| 48 | 50 | if ( !defined( 'AYG_FILE_NAME' ) ) { |
| 49 | 51 | define( 'AYG_FILE_NAME', plugin_basename( __FILE__ ) ); |
| 50 | 52 | } |
| 53 | + | |
| 51 | 54 | if ( !function_exists( 'ayg_fs' ) ) { |
| 52 | 55 | // Create a helper function for easy SDK access |
| 53 | - function ayg_fs() { | |
| 54 | - global $ayg_fs; | |
| 56 | + function ayg_fs() | |
| 57 | + { | |
| 58 | + global $ayg_fs ; | |
| 59 | + | |
| 55 | 60 | if ( !isset( $ayg_fs ) ) { |
| 56 | 61 | // Activate multisite network integration |
| 57 | 62 | if ( !defined( 'WP_FS__PRODUCT_2922_MULTISITE' ) ) { |
| 58 | 63 | define( 'WP_FS__PRODUCT_2922_MULTISITE', true ); |
| @@ -57,68 +62,71 @@ | ||
| 57 | 62 | if ( !defined( 'WP_FS__PRODUCT_2922_MULTISITE' ) ) { |
| 58 | 63 | define( 'WP_FS__PRODUCT_2922_MULTISITE', true ); |
| 59 | 64 | } |
| 60 | 65 | // Include Freemius SDK |
| 61 | - require_once dirname( __FILE__ ) . '/vendor/freemius/start.php'; | |
| 66 | + require_once dirname( __FILE__ ) . '/freemius/start.php'; | |
| 62 | 67 | $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 | - 'is_org_compliant' => true, | |
| 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, | |
| 81 | 86 | ) ); |
| 82 | 87 | } |
| 88 | + | |
| 83 | 89 | return $ayg_fs; |
| 84 | 90 | } |
| 85 | - | |
| 91 | + | |
| 86 | 92 | // Init Freemius |
| 87 | 93 | ayg_fs(); |
| 88 | 94 | // Signal that SDK was initiated |
| 89 | 95 | do_action( 'ayg_fs_loaded' ); |
| 90 | 96 | } |
| 97 | + | |
| 98 | + | |
| 91 | 99 | if ( !function_exists( 'activate_ayg' ) ) { |
| 92 | 100 | /** |
| 93 | 101 | * The code that runs during plugin activation. |
| 94 | 102 | * This action is documented in includes/activator.php |
| 95 | 103 | */ |
| 96 | - function activate_ayg( $network_wide ) { | |
| 97 | - if ( is_multisite() && $network_wide ) { | |
| 98 | - deactivate_plugins( AYG_FILE_NAME ); | |
| 99 | - 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( | |
| 100 | - 'back_link' => true, | |
| 101 | - ) ); | |
| 102 | - } | |
| 104 | + function activate_ayg() | |
| 105 | + { | |
| 103 | 106 | require_once AYG_DIR . 'includes/activator.php'; |
| 104 | 107 | AYG_Activator::activate(); |
| 105 | 108 | } |
| 106 | - | |
| 109 | + | |
| 107 | 110 | register_activation_hook( __FILE__, 'activate_ayg' ); |
| 108 | 111 | } |
| 112 | + | |
| 113 | + | |
| 109 | 114 | if ( !function_exists( 'deactivate_ayg' ) ) { |
| 110 | 115 | /** |
| 111 | 116 | * The code that runs during plugin deactivation. |
| 112 | 117 | * This action is documented in includes/deactivator.php |
| 113 | 118 | */ |
| 114 | - function deactivate_ayg() { | |
| 119 | + function deactivate_ayg() | |
| 120 | + { | |
| 115 | 121 | require_once AYG_DIR . 'includes/deactivator.php'; |
| 116 | 122 | AYG_Deactivator::deactivate(); |
| 117 | 123 | } |
| 118 | - | |
| 124 | + | |
| 119 | 125 | register_deactivation_hook( __FILE__, 'deactivate_ayg' ); |
| 120 | 126 | } |
| 127 | + | |
| 128 | + | |
| 121 | 129 | if ( !function_exists( 'run_ayg' ) ) { |
| 122 | 130 | /** |
| 123 | 131 | * Begins execution of the plugin. |
| 124 | 132 | * |
| @@ -127,16 +135,19 @@ | ||
| 127 | 135 | * not affect the page life cycle. |
| 128 | 136 | * |
| 129 | 137 | * @since 1.0.0 |
| 130 | 138 | */ |
| 131 | - function run_ayg() { | |
| 139 | + function run_ayg() | |
| 140 | + { | |
| 132 | 141 | require_once AYG_DIR . 'includes/init.php'; |
| 133 | 142 | $plugin = new AYG_Init(); |
| 134 | 143 | $plugin->run(); |
| 135 | 144 | } |
| 136 | - | |
| 145 | + | |
| 137 | 146 | run_ayg(); |
| 138 | 147 | } |
| 148 | + | |
| 149 | + | |
| 139 | 150 | if ( !function_exists( 'ayg_fs_uninstall_cleanup' ) ) { |
| 140 | 151 | /** |
| 141 | 152 | * Plugin uninstall cleanup. |
| 142 | 153 | * |
| @@ -141,18 +152,18 @@ | ||
| 141 | 152 | * Plugin uninstall cleanup. |
| 142 | 153 | * |
| 143 | 154 | * @since 1.0.0 |
| 144 | 155 | */ |
| 145 | - function ayg_fs_uninstall_cleanup() { | |
| 146 | - global $wpdb; | |
| 156 | + function ayg_fs_uninstall_cleanup() | |
| 157 | + { | |
| 158 | + global $wpdb ; | |
| 147 | 159 | // Delete all the plugin transients |
| 148 | - $transient_keys = array_filter( (array) get_option( 'ayg_transient_keys' ) ); | |
| 160 | + $transient_keys = get_option( 'ayg_transient_keys', array() ); | |
| 149 | 161 | foreach ( $transient_keys as $key ) { |
| 150 | - delete_transient( sanitize_key( $key ) ); | |
| 162 | + delete_transient( $key ); | |
| 151 | 163 | } |
| 152 | 164 | // Delete all the plugin options |
| 153 | 165 | delete_option( 'ayg_general_settings' ); |
| 154 | - delete_option( 'ayg_strings_settings' ); | |
| 155 | 166 | delete_option( 'ayg_gallery_settings' ); |
| 156 | 167 | delete_option( 'ayg_player_settings' ); |
| 157 | 168 | delete_option( 'ayg_livestream_settings' ); |
| 158 | 169 | delete_option( 'ayg_seo_settings' ); |
| @@ -161,12 +172,10 @@ | ||
| 161 | 172 | delete_option( 'ayg_channel_ids' ); |
| 162 | 173 | delete_option( 'ayg_playlist_ids' ); |
| 163 | 174 | delete_option( 'ayg_transient_keys' ); |
| 164 | 175 | delete_option( 'ayg_version' ); |
| 165 | - // Delete our custom database tables | |
| 176 | + // Delete our custom database table "{$wpdb->prefix}ayg_videos" | |
| 166 | 177 | $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}ayg_videos" ); |
| 167 | - $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}ayg_galleries" ); | |
| 168 | - $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}ayg_gallery_relationships" ); | |
| 169 | 178 | } |
| 170 | - | |
| 179 | + | |
| 171 | 180 | ayg_fs()->add_action( 'after_uninstall', 'ayg_fs_uninstall_cleanup' ); |
| 172 | -} | |
| 181 | +} | |