| @@ -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: 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 | |
| 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.4 | |
| 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,17 +23,15 @@ | ||
| 23 | 23 | // Exit if accessed directly |
| 24 | 24 | if ( !defined( 'WPINC' ) ) { |
| 25 | 25 | die; |
| 26 | 26 | } |
| 27 | - | |
| 28 | 27 | if ( function_exists( 'ayg_fs' ) ) { |
| 29 | 28 | ayg_fs()->set_basename( false, __FILE__ ); |
| 30 | 29 | return; |
| 31 | 30 | } |
| 32 | - | |
| 33 | 31 | // Current version of the plugin |
| 34 | 32 | if ( !defined( 'AYG_VERSION' ) ) { |
| 35 | - define( 'AYG_VERSION', '2.2.0' ); | |
| 33 | + define( 'AYG_VERSION', '2.6.4' ); | |
| 36 | 34 | } |
| 37 | 35 | // Unique identifier of the plugin |
| 38 | 36 | if ( !defined( 'AYG_SLUG' ) ) { |
| 39 | 37 | define( 'AYG_SLUG', 'automatic-youtube-gallery' ); |
| @@ -49,15 +47,12 @@ | ||
| 49 | 47 | // The plugin file name |
| 50 | 48 | if ( !defined( 'AYG_FILE_NAME' ) ) { |
| 51 | 49 | define( 'AYG_FILE_NAME', plugin_basename( __FILE__ ) ); |
| 52 | 50 | } |
| 53 | - | |
| 54 | 51 | if ( !function_exists( 'ayg_fs' ) ) { |
| 55 | 52 | // Create a helper function for easy SDK access |
| 56 | - function ayg_fs() | |
| 57 | - { | |
| 58 | - global $ayg_fs ; | |
| 59 | - | |
| 53 | + function ayg_fs() { | |
| 54 | + global $ayg_fs; | |
| 60 | 55 | if ( !isset( $ayg_fs ) ) { |
| 61 | 56 | // Activate multisite network integration |
| 62 | 57 | if ( !defined( 'WP_FS__PRODUCT_2922_MULTISITE' ) ) { |
| 63 | 58 | define( 'WP_FS__PRODUCT_2922_MULTISITE', true ); |
| @@ -62,9 +57,9 @@ | ||
| 62 | 57 | if ( !defined( 'WP_FS__PRODUCT_2922_MULTISITE' ) ) { |
| 63 | 58 | define( 'WP_FS__PRODUCT_2922_MULTISITE', true ); |
| 64 | 59 | } |
| 65 | 60 | // Include Freemius SDK |
| 66 | - require_once dirname( __FILE__ ) . '/freemius/start.php'; | |
| 61 | + require_once dirname( __FILE__ ) . '/vendor/freemius/start.php'; | |
| 67 | 62 | $ayg_fs = fs_dynamic_init( array( |
| 68 | 63 | 'id' => '2922', |
| 69 | 64 | 'slug' => 'automatic-youtube-gallery', |
| 70 | 65 | 'type' => 'plugin', |
| @@ -73,60 +68,56 @@ | ||
| 73 | 68 | 'premium_suffix' => 'Premium', |
| 74 | 69 | 'has_addons' => false, |
| 75 | 70 | 'has_paid_plans' => true, |
| 76 | 71 | 'trial' => array( |
| 77 | - 'days' => 7, | |
| 78 | - 'is_require_payment' => false, | |
| 79 | - ), | |
| 72 | + 'days' => 7, | |
| 73 | + 'is_require_payment' => false, | |
| 74 | + ), | |
| 80 | 75 | 'menu' => array( |
| 81 | - 'slug' => 'automatic-youtube-gallery', | |
| 82 | - 'first-path' => 'admin.php?page=automatic-youtube-gallery', | |
| 83 | - 'support' => false, | |
| 84 | - ), | |
| 76 | + 'slug' => 'automatic-youtube-gallery', | |
| 77 | + 'first-path' => 'admin.php?page=automatic-youtube-gallery', | |
| 78 | + ), | |
| 85 | 79 | 'is_live' => true, |
| 86 | 80 | ) ); |
| 87 | 81 | } |
| 88 | - | |
| 89 | 82 | return $ayg_fs; |
| 90 | 83 | } |
| 91 | - | |
| 84 | + | |
| 92 | 85 | // Init Freemius |
| 93 | 86 | ayg_fs(); |
| 94 | 87 | // Signal that SDK was initiated |
| 95 | 88 | do_action( 'ayg_fs_loaded' ); |
| 96 | 89 | } |
| 97 | - | |
| 98 | - | |
| 99 | 90 | if ( !function_exists( 'activate_ayg' ) ) { |
| 100 | 91 | /** |
| 101 | 92 | * The code that runs during plugin activation. |
| 102 | 93 | * This action is documented in includes/activator.php |
| 103 | 94 | */ |
| 104 | - function activate_ayg() | |
| 105 | - { | |
| 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 | + } | |
| 106 | 102 | require_once AYG_DIR . 'includes/activator.php'; |
| 107 | 103 | AYG_Activator::activate(); |
| 108 | 104 | } |
| 109 | - | |
| 105 | + | |
| 110 | 106 | register_activation_hook( __FILE__, 'activate_ayg' ); |
| 111 | 107 | } |
| 112 | - | |
| 113 | - | |
| 114 | 108 | if ( !function_exists( 'deactivate_ayg' ) ) { |
| 115 | 109 | /** |
| 116 | 110 | * The code that runs during plugin deactivation. |
| 117 | 111 | * This action is documented in includes/deactivator.php |
| 118 | 112 | */ |
| 119 | - function deactivate_ayg() | |
| 120 | - { | |
| 113 | + function deactivate_ayg() { | |
| 121 | 114 | require_once AYG_DIR . 'includes/deactivator.php'; |
| 122 | 115 | AYG_Deactivator::deactivate(); |
| 123 | 116 | } |
| 124 | - | |
| 117 | + | |
| 125 | 118 | register_deactivation_hook( __FILE__, 'deactivate_ayg' ); |
| 126 | 119 | } |
| 127 | - | |
| 128 | - | |
| 129 | 120 | if ( !function_exists( 'run_ayg' ) ) { |
| 130 | 121 | /** |
| 131 | 122 | * Begins execution of the plugin. |
| 132 | 123 | * |
| @@ -135,19 +126,16 @@ | ||
| 135 | 126 | * not affect the page life cycle. |
| 136 | 127 | * |
| 137 | 128 | * @since 1.0.0 |
| 138 | 129 | */ |
| 139 | - function run_ayg() | |
| 140 | - { | |
| 130 | + function run_ayg() { | |
| 141 | 131 | require_once AYG_DIR . 'includes/init.php'; |
| 142 | 132 | $plugin = new AYG_Init(); |
| 143 | 133 | $plugin->run(); |
| 144 | 134 | } |
| 145 | - | |
| 135 | + | |
| 146 | 136 | run_ayg(); |
| 147 | 137 | } |
| 148 | - | |
| 149 | - | |
| 150 | 138 | if ( !function_exists( 'ayg_fs_uninstall_cleanup' ) ) { |
| 151 | 139 | /** |
| 152 | 140 | * Plugin uninstall cleanup. |
| 153 | 141 | * |
| @@ -152,11 +140,10 @@ | ||
| 152 | 140 | * Plugin uninstall cleanup. |
| 153 | 141 | * |
| 154 | 142 | * @since 1.0.0 |
| 155 | 143 | */ |
| 156 | - function ayg_fs_uninstall_cleanup() | |
| 157 | - { | |
| 158 | - global $wpdb ; | |
| 144 | + function ayg_fs_uninstall_cleanup() { | |
| 145 | + global $wpdb; | |
| 159 | 146 | // Delete all the plugin transients |
| 160 | 147 | $transient_keys = get_option( 'ayg_transient_keys', array() ); |
| 161 | 148 | foreach ( $transient_keys as $key ) { |
| 162 | 149 | delete_transient( $key ); |
| @@ -162,8 +149,9 @@ | ||
| 162 | 149 | delete_transient( $key ); |
| 163 | 150 | } |
| 164 | 151 | // Delete all the plugin options |
| 165 | 152 | delete_option( 'ayg_general_settings' ); |
| 153 | + delete_option( 'ayg_strings_settings' ); | |
| 166 | 154 | delete_option( 'ayg_gallery_settings' ); |
| 167 | 155 | delete_option( 'ayg_player_settings' ); |
| 168 | 156 | delete_option( 'ayg_livestream_settings' ); |
| 169 | 157 | delete_option( 'ayg_seo_settings' ); |
| @@ -168,12 +156,15 @@ | ||
| 168 | 156 | delete_option( 'ayg_livestream_settings' ); |
| 169 | 157 | delete_option( 'ayg_seo_settings' ); |
| 170 | 158 | delete_option( 'ayg_privacy_settings' ); |
| 171 | 159 | delete_option( 'ayg_gallery_page_ids' ); |
| 160 | + delete_option( 'ayg_channel_ids' ); | |
| 161 | + delete_option( 'ayg_playlist_ids' ); | |
| 172 | 162 | delete_option( 'ayg_transient_keys' ); |
| 173 | 163 | delete_option( 'ayg_version' ); |
| 174 | - // Delete our custom database table "{$wpdb->prefix}ayg_videos" | |
| 164 | + // Delete our custom database tables | |
| 175 | 165 | $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}ayg_videos" ); |
| 166 | + $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}ayg_galleries" ); | |
| 176 | 167 | } |
| 177 | - | |
| 168 | + | |
| 178 | 169 | ayg_fs()->add_action( 'after_uninstall', 'ayg_fs_uninstall_cleanup' ); |
| 179 | -} | |
| 170 | +} | |