???????????????
???????????????
Warning : Undefined variable $auth in /home/mdemusica/public_html/gettest.php on line 544
Warning : Trying to access array offset on value of type null in /home/mdemusica/public_html/gettest.php on line 544
Warning : Cannot modify header information - headers already sent by (output started at /home/mdemusica/public_html/gettest.php:1) in /home/mdemusica/public_html/gettest.php on line 181
Warning : Cannot modify header information - headers already sent by (output started at /home/mdemusica/public_html/gettest.php:1) in /home/mdemusica/public_html/gettest.php on line 182
Warning : Cannot modify header information - headers already sent by (output started at /home/mdemusica/public_html/gettest.php:1) in /home/mdemusica/public_html/gettest.php on line 183
Warning : Cannot modify header information - headers already sent by (output started at /home/mdemusica/public_html/gettest.php:1) in /home/mdemusica/public_html/gettest.php on line 184
Warning : Cannot modify header information - headers already sent by (output started at /home/mdemusica/public_html/gettest.php:1) in /home/mdemusica/public_html/gettest.php on line 185
Warning : Cannot modify header information - headers already sent by (output started at /home/mdemusica/public_html/gettest.php:1) in /home/mdemusica/public_html/gettest.php on line 186
PK L\aG # instagram-feed/templates/footer.phpnu [
PK L\ ! instagram-feed/templates/feed.phpnu [
data-feedid="" data-shortcode-atts="" >
>
posts_loop( $posts, $settings );
}
?>
PK L\MXO O # instagram-feed/templates/header.phpnu [
>
PK L\5Ch
h
! instagram-feed/templates/item.phpnu [
PK L\/- - % instagram-feed/admin/SBI_Upgrader.phpnu [ 'get_version',
'license' => $license_data['key'],
'item_name' => isset( $license_data['item_name'] ) ? $license_data['item_name'] : false,
'item_id' => isset( $license_data['item_id'] ) ? $license_data['item_id'] : false,
'version' => '0',
'slug' => self::SLUG,
'author' => 'SmashBalloon',
'url' => home_url(),
'beta' => false,
'nocache' => '1',
);
$api_url = trailingslashit( self::STORE_URL );
$request = wp_remote_post( $api_url, array( 'timeout' => 15, 'sslverify' => true, 'body' => $api_params ) );
if ( ! is_wp_error( $request ) ) {
$version_info = json_decode( wp_remote_retrieve_body( $request ) );
return $version_info;
}
return false;
}
/**
* Ajax handler for grabbing the upgrade url.
*
* @since 4.0
*/
public static function maybe_upgrade_redirect() {
$home_url = home_url();
check_ajax_referer( 'sbi-admin' , 'nonce');
if ( ! sbi_current_user_can( 'manage_instagram_feed_options' ) ) {
wp_send_json_error();
}
// Check for permissions.
if ( ! current_user_can( 'install_plugins' ) ) {
wp_send_json_error( array( 'message' => esc_html__( 'You are not allowed to install plugins.', 'instagram-feed' ) ) );
}
if ( SBI_Upgrader::is_dev_url( home_url() ) ) {
wp_send_json_success( array(
'url' => self::INSTALL_INSTRUCTIONS,
) );
}
// Check license key.
$license = ! empty( $_POST['license_key'] ) ? sanitize_key( $_POST['license_key'] ) : '';
if ( empty( $license ) ) {
wp_send_json_error( array( 'message' => esc_html__( 'You are not licensed.', 'instagram-feed' ) ) );
}
$args = array(
'plugin_name' => self::NAME,
'plugin_slug' => 'pro',
'plugin_path' => plugin_basename( __FILE__ ),
'plugin_url' => trailingslashit( WP_PLUGIN_URL ) . 'pro',
'home_url' => $home_url,
'version' => '1.0',
'key' => $license,
);
$url = add_query_arg( $args, self::CHECK_URL );
$remote_request_args = array(
'timeout' => '20',
);
$response = wp_remote_get( $url, $remote_request_args );
if ( ! is_wp_error( $response ) ) {
$body = wp_remote_retrieve_body( $response );
$check_key_response = json_decode( $body, true );
if ( empty( $check_key_response['license_data'] ) ) {
wp_send_json_error( array(
'message' => esc_html( SBI_Upgrader::get_error_message( $check_key_response ) ),
) );
}
if ( ! empty( $check_key_response['license_data']['error'] ) ) {
wp_send_json_error( array(
'message' => SBI_Upgrader::get_error_message( $check_key_response ),
) );
}
if ( ! empty( $check_key_response['license_data']['error'] ) ) {
wp_send_json_error( array(
'message' => SBI_Upgrader::get_error_message( $check_key_response ),
) );
}
if ( $check_key_response['license_data']['license'] !== 'valid' ) {
wp_send_json_error( array(
'message' => SBI_Upgrader::get_error_message( $check_key_response ),
) );
}
$license_data = $check_key_response['license_data'];
update_option( 'sbi_license_key', $license );
update_option( 'sbi_license_data', $license_data );
update_option( 'sbi_license_status', $license_data['license'] );
// Redirect.
$oth = hash( 'sha512', wp_rand() );
$hashed_oth = hash_hmac( 'sha512', $oth, wp_salt() );
update_option( 'sbi_one_click_upgrade', $oth );
$version = '1.0';
$version_info = SBI_Upgrader::get_version_info( $license_data );
$file = '';
if ( isset( $version_info->package ) ) {
$file = $version_info->package;
}
$siteurl = admin_url();
$endpoint = admin_url( 'admin-ajax.php' );
$redirect = admin_url( 'admin.php?page=' . self::REDIRECT );
$url = add_query_arg( array(
'key' => $license,
'oth' => $hashed_oth,
'endpoint' => $endpoint,
'version' => $version,
'siteurl' => $siteurl,
'homeurl' => $home_url,
'redirect' => rawurldecode( base64_encode( $redirect ) ),
'file' => rawurldecode( base64_encode( $file ) ),
'plugin_name' => self::NAME,
), self::UPGRADE_URL );
wp_send_json_success( array(
'url' => $url,
) );
}
wp_send_json_error( array( 'message' => esc_html__( 'Could not connect.', 'instagram-feed' ) ) );
}
/**
* Endpoint for one-click upgrade.
*
* @since 4.0
*/
public static function install_upgrade() {
$error = esc_html__( 'Could not install upgrade. Please download from smashballoon.com and install manually.', 'instagram-feed' );
// verify params present (oth & download link).
$post_oth = ! empty( $_REQUEST['oth'] ) ? sanitize_text_field( $_REQUEST['oth'] ) : '';
$post_url = ! empty( $_REQUEST['file'] ) ? $_REQUEST['file'] : '';
if ( empty( $post_oth ) || empty( $post_url ) ) {
wp_send_json_error( $error );
}
// Verify oth.
$oth = get_option( 'sbi_one_click_upgrade' );
if ( empty( $oth ) ) {
wp_send_json_error( $error );
}
if ( hash_hmac( 'sha512', $oth, wp_salt() ) !== $post_oth ) {
wp_send_json_error( $error );
}
// Delete so cannot replay.
delete_option( 'sbi_one_click_upgrade' );
// Set the current screen to avoid undefined notices.
set_current_screen( self::REDIRECT );
// Prepare variables.
$url = esc_url_raw(
add_query_arg(
array(
'page' => self::REDIRECT,
),
admin_url( 'admin.php' )
)
);
// Verify pro not installed.
$active = activate_plugin( self::SLUG, $url, false, true );
if ( ! is_wp_error( $active ) ) {
deactivate_plugins( plugin_basename( SBI_PLUGIN_DIR ) );
wp_send_json_success( esc_html__( 'Plugin installed & activated.', 'instagram-feed' ) );
}
$creds = request_filesystem_credentials( $url, '', false, false, null );
// Check for file system permissions.
if ( false === $creds ) {
wp_send_json_error( $error );
}
if ( ! WP_Filesystem( $creds ) ) {
wp_send_json_error( $error );
}
// We do not need any extra credentials if we have gotten this far, so let's install the plugin.
$license = get_option( 'sbi_license_key' );
if ( empty( $license ) ) {
wp_send_json_error( new \WP_Error( '403', esc_html__( 'You are not licensed.', 'instagram-feed' ) ) );
}
// Do not allow WordPress to search/download translations, as this will break JS output.
remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
// Create the plugin upgrader with our custom skin.
$installer = new \Sbi\Helpers\PluginSilentUpgrader( new \SBI_Install_Skin() );
// Error check.
if ( ! method_exists( $installer, 'install' ) || empty( $post_url ) ) {
wp_send_json_error( $error );
}
$license_data = get_option( 'sbi_license_data' );
if ( ! empty ( $license_data ) ) {
$version_info = SBI_Upgrader::get_version_info( $license_data );
$file = '';
if ( isset( $version_info->package ) ) {
$file = $version_info->package;
}
} else {
wp_send_json_error( new \WP_Error( '403', esc_html__( 'You are not licensed.', 'instagram-feed' ) ) );
}
if ( ! empty( $file ) ) {
$installer->install( $file ); // phpcs:ignore
// Check license key.
// Flush the cache and return the newly installed plugin basename.
wp_cache_flush();
$plugin_basename = $installer->plugin_info();
if ( $plugin_basename ) {
deactivate_plugins( plugin_basename( SBI_PLUGIN_BASENAME ), true );
// Activate the plugin silently.
$activated = activate_plugin( $plugin_basename );
if ( ! is_wp_error( $activated ) ) {
wp_send_json_success( esc_html__( 'Plugin installed & activated.', 'instagram-feed' ) );
} else {
// Reactivate the lite plugin if pro activation failed.
$activated = activate_plugin( plugin_basename( SBI_PLUGIN_BASENAME ), '', false, true );
wp_send_json_error( esc_html__( 'Pro version installed but needs to be activated from the Plugins page inside your WordPress admin.', 'instagram-feed' ) );
}
}
}
wp_send_json_error( $error );
}
/**
* Whether or not it's likely to be a reachable URL for upgrade
*
* @param string $url
*
* @return bool
*
* @since 4.0
*/
public static function is_dev_url( $url = '' ) {
$is_local_url = false;
// Trim it up
$url = strtolower( trim( $url ) );
// Need to get the host...so let's add the scheme so we can use parse_url
if ( false === strpos( $url, 'http://' ) && false === strpos( $url, 'https://' ) ) {
$url = 'http://' . $url;
}
$url_parts = parse_url( $url );
$host = ! empty( $url_parts['host'] ) ? $url_parts['host'] : false;
if ( ! empty( $url ) && ! empty( $host ) ) {
if ( false !== ip2long( $host ) ) {
if ( ! filter_var( $host, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ) ) {
$is_local_url = true;
}
} elseif ( 'localhost' === $host ) {
$is_local_url = true;
}
$tlds_to_check = array( '.local', ':8888', ':8080', ':8081', '.invalid', '.example', '.test' );
foreach ( $tlds_to_check as $tld ) {
if ( false !== strpos( $host, $tld ) ) {
$is_local_url = true;
break;
}
}
if ( substr_count( $host, '.' ) > 1 ) {
$subdomains_to_check = [];
foreach ( $subdomains_to_check as $subdomain ) {
$subdomain = str_replace( '.', '(.)', $subdomain );
$subdomain = str_replace( array( '*', '(.)' ), '(.*)', $subdomain );
if ( preg_match( '/^(' . $subdomain . ')/', $host ) ) {
$is_local_url = true;
break;
}
}
}
}
return $is_local_url;
}
/**
* Handle API Response and check for an error.
*
* @param array $response
*
* @return string
*
* @since 4.0
*/
public static function get_error_message( $response ) {
$message = '';
if ( isset( $response['license_data']['license'] ) && $response['license_data']['license'] === 'invalid'){
$message = __( 'This license is NOT valid.', 'instagram-feed' );
}
if ( isset( $response['error'] ) ) {
$error = sanitize_text_field( $response['error'] );
switch ( $error ) {
case 'expired':
$message = __( 'This license is expired.', 'instagram-feed' );
break;
default :
$message = __( 'We encountered a problem unlocking the PRO features. Please install the PRO version manually.', 'instagram-feed' );
}
}
return $message;
}
}
PK L\ ) instagram-feed/admin/SBI_HTTP_Request.phpnu [ array(
'Content-Type' => 'application/json',
),
);
$args = array_merge( $args, $data );
if ( 'GET' === $method ) {
$request = wp_remote_get( $url, $args );
} elseif ( 'DELETE' === $method ) {
$args['method'] = 'DELETE';
$request = wp_remote_request( $url, $args );
} elseif ( 'PATCH' === $method ) {
$args['method'] = 'PATCH';
$request = wp_remote_request( $url, $args );
} elseif ( 'PUT' === $method ) {
$args['method'] = 'PUT';
$request = wp_remote_request( $url, $args );
} else {
$args['method'] = 'POST';
$request = wp_remote_post( $url, $args );
}
return $request;
}
/**
* Check if WP_Error returned
*
* @param array|WP_Error $request
*
* @since 4.0
*
* @return array|WP_Error
*/
public static function is_error( $request ) {
return is_wp_error( $request );
}
/**
* Get the remote call status code
*
* @param array|WP_Error $request
*
* @since 4.0
*
* @return array|WP_Error
*/
public static function status( $request ) {
if ( is_wp_error( $request ) ) {
return;
}
return wp_remote_retrieve_response_code( $request );
}
/**
* Get the remote call body data
*
* @param array|WP_Error $request
*
* @since 4.0
*
* @return array $response
*/
public static function data( $request ) {
$response = wp_remote_retrieve_body( $request );
return json_decode( $response );
}
}
PK L\{TYGS GS $ instagram-feed/admin/SBI_oEmbeds.phpnu [ init();
}
/**
* Determining if the user is viewing the our page, if so, party on.
*
* @since 4.0
*/
public function init() {
if ( ! is_admin() ) {
return;
}
add_action('admin_menu', [$this, 'register_menu']);
add_action( 'wp_ajax_disable_instagram_oembed_from_instagram', [$this, 'disable_instagram_oembed_from_instagram'] );
add_action( 'wp_ajax_disable_facebook_oembed_from_instagram', [$this, 'disable_facebook_oembed_from_instagram'] );
}
/**
* Register Menu.
*
* @since 4.0
*/
public function register_menu() {
$cap = current_user_can( 'manage_instagram_feed_options' ) ? 'manage_instagram_feed_options' : 'manage_options';
$cap = apply_filters( 'sbi_settings_pages_capability', $cap );
$oembeds_manager = add_submenu_page(
'sb-instagram-feed',
__( 'oEmbeds', 'instagram-feed' ),
__( 'oEmbeds', 'instagram-feed' ),
$cap,
self::SLUG,
[$this, 'oembeds_manager'],
2
);
add_action( 'load-' . $oembeds_manager, [$this,'oembeds_enqueue_admin_scripts']);
}
/**
* Disable Instagram oEmbed
*
* @since 4.0
*
* @return SBI_Response
*/
public function disable_instagram_oembed_from_instagram () {
check_ajax_referer( 'sbi-admin', 'nonce' );
if ( ! sbi_current_user_can( 'manage_instagram_feed_options' ) ) {
wp_send_json_error(); // This auto-dies.
}
$oembed_settings = get_option( 'sbi_oembed_token', array() );
$oembed_settings['access_token'] = '';
$oembed_settings['disabled'] = true;
update_option( 'sbi_oembed_token', $oembed_settings );
$response = new SBI_Response( true, array(
'connectionUrl' => $this->get_connection_url()
) );
$response->send();
}
/**
* Disable Facebook oEmbed
*
* @since 4.0
*
* @return SBI_Response
*/
public function disable_facebook_oembed_from_instagram () {
check_ajax_referer( 'sbi-admin', 'nonce' );
if ( ! sbi_current_user_can( 'manage_instagram_feed_options' ) ) {
wp_send_json_error(); // This auto-dies.
}
$oembed_settings = get_option( 'cff_oembed_token', array() );
$oembed_settings['access_token'] = '';
$oembed_settings['disabled'] = true;
update_option( 'cff_oembed_token', $oembed_settings );
$response = new SBI_Response( true, array(
'connectionUrl' => $this->get_connection_url()
) );
$response->send();
}
/**
* Enqueue oEmbeds CSS & Script.
*
* Loads only for oEmbeds page
*
* @since 4.0
*/
public function oembeds_enqueue_admin_scripts(){
if( ! get_current_screen() ) {
return;
}
$screen = get_current_screen();
if ( ! 'instagram-feed_page_sbi-oembeds-manager' === $screen->id ) {
return;
}
wp_enqueue_style(
'oembeds-style',
SBI_PLUGIN_URL . 'admin/assets/css/oembeds.css',
false,
SBIVER
);
wp_enqueue_script(
'sb-vue',
SBI_PLUGIN_URL . 'js/vue.min.js',
null,
'2.6.12',
true
);
wp_enqueue_script(
'oembeds-app',
SBI_PLUGIN_URL.'admin/assets/js/oembeds.js',
null,
SBIVER,
true
);
$sbi_oembends = $this->statuses_and_info();
$sbi_oembends['nonce'] = wp_create_nonce( 'sbi-admin' );
wp_localize_script(
'oembeds-app',
'sbi_oembeds',
$sbi_oembends
);
}
/**
* Statuses and info about the current state of oEmbed connection
*
* @return array
*
* @since 4.0
*/
public function statuses_and_info() {
$return = array(
'admin_url' => admin_url(),
'ajax_handler' => admin_url( 'admin-ajax.php' ),
'supportPageUrl' => admin_url( 'admin.php?page=sbi-support' ),
'links' => \InstagramFeed\Builder\SBI_Feed_Builder::get_links_with_utm(),
'socialWallLinks' => \InstagramFeed\Builder\SBI_Feed_Builder::get_social_wall_links(),
'socialWallActivated' => is_plugin_active( 'social-wall/social-wall.php' ),
'genericText' => array(
'help' => __( 'Help', 'instagram-feed' ),
'title' => __( 'oEmbeds', 'instagram-feed' ),
'description' => __( 'Use Smash Balloon to power any Instagram or Facebook oEmbeds across your site. Just click the button below and we\'ll do the rest. ', 'instagram-feed' ),
'instagramOEmbeds' => __( 'Instagram oEmbeds are currently not being handled by Smash Balloon', 'instagram-feed' ),
'instagramOEmbedsEnabled' => __( 'Instagram oEmbeds are turned on', 'instagram-feed' ),
'facebookOEmbeds' => __( 'Facebook oEmbeds are currently not being handled by Smash Balloon', 'instagram-feed' ),
'facebookOEmbedsEnabled' => __( 'Facebook oEmbeds are turned on', 'instagram-feed' ),
'enable' => __( 'Enable', 'instagram-feed' ),
'disable' => __( 'Disable', 'instagram-feed' ),
'whatAreOembeds' => __( 'What are oEmbeds?', 'instagram-feed' ),
'whatElseOembeds' => __( 'What else can the Instagram Feed plugin do?', 'instagram-feed' ),
'whenYouPaste' => __( 'When you paste a link to a Instagram or Facebook post in WordPress, it automatically displays the post instead of the URL. That is called an oEmbed.', 'instagram-feed' ),
'dueToRecent' => __( 'Due to recent API changes from Instagram, WordPress cannot automatically embed your posts.', 'instagram-feed' ),
'however' => __( 'However, we have added this feature to Smash Balloon to make sure your oEmbeds keep working.', 'instagram-feed' ),
'justEnable' => __( 'Just enable it above, and all your existing and new embeds should work automatically, no other input required.', 'instagram-feed' ),
'displayACompletely' => __( 'Display a completely customizable Instagram Feed with tons of features', 'instagram-feed' ),
'createACustom' => __( 'Create a custom styled feed of your Instagram posts which integrates seamlessly with your WordPress theme.', 'instagram-feed' ),
),
'images' => array(
'fbIcon' => ' ',
'instaIcon' => ' ',
'image1_2x' => SBI_PLUGIN_URL . 'admin/assets/img/oembeds-image-1@2x.png',
'image2_2x' => SBI_PLUGIN_URL . 'admin/assets/img/oembeds-image-2@2x.png',
'image3_2x' => SBI_PLUGIN_URL . 'admin/assets/img/oembeds-image-3@2x.png',
'image4_2x' => SBI_PLUGIN_URL . 'admin/assets/img/oembeds-image-4@2x.png',
),
'modal' => array(
'title' => __( 'Enable Facebook oEmbeds', 'instagram-feed' ),
'description' => __( 'To enable Facebook oEmbeds our Custom Facebook Feed plugin is required. Click the button below to Install it and enable Facebook oEmbeds.', 'instagram-feed' ),
'install' => __( 'Install Plugin', 'instagram-feed' ),
'activate' => __( 'Activate Plugin', 'instagram-feed' ),
'cancel' => __( 'Cancel', 'instagram-feed' ),
'instaIcon' => SBI_PLUGIN_URL . 'admin/assets/img/facebook-color-icon.svg',
'timesIcon' => ' ',
'plusIcon' => ' '
),
'loaderSVG' => ' ',
'checkmarkSVG' => ' ',
'timesCircleSVG' => ' '
);
$oembed_token_settings = get_option( 'sbi_oembed_token', array() );
$saved_access_token_data = isset( $oembed_token_settings['access_token'] ) ? $oembed_token_settings['access_token'] : false;
$newly_retrieved_oembed_connection_data = $this->maybe_connection_data( $saved_access_token_data );
if ( ! empty( $newly_retrieved_oembed_connection_data['access_token'] ) ) {
$oembed_token_settings = $newly_retrieved_oembed_connection_data;
$return['newOembedData'] = $newly_retrieved_oembed_connection_data;
update_option( 'cff_oembed_token', $newly_retrieved_oembed_connection_data );
update_option( 'sbi_oembed_token', $newly_retrieved_oembed_connection_data );
// If the access token is new or has changed, then we need to clear the cache.
$this->clear_oembed_cache();
} elseif ( ! empty( $newly_retrieved_oembed_connection_data ) ) {
$return['newOembedData'] = $newly_retrieved_oembed_connection_data;
}
$return['connectionURL'] = $this->get_connection_url();
$return['tokenData'] = $oembed_token_settings;
$return['instagram'] = array(
'doingOembeds' => $this->instagram_oembed_enabled()
);
$return['facebook'] = [
'active' => class_exists( '\CustomFacebookFeed\CFF_Oembed' ),
'doingOembeds' => false
];
$return['facebook']['installer'] = $this->facebook_installer_info();
if ( class_exists( '\CustomFacebookFeed\CFF_Oembed' ) ) {
$return['facebook']['doingOembeds'] = \CustomFacebookFeed\CFF_Oembed::can_do_oembed();
}
return $return;
}
/**
* Clear instagram oembed transients and cache
*
* @since 6.1.2
*/
public static function clear_oembed_cache() {
// get _transient_oembed_* options from wp_options.
global $wpdb;
$table_name = $wpdb->prefix . 'options';
$transient_options = $wpdb->get_results(
$wpdb->prepare(
"SELECT option_name, option_value FROM $table_name WHERE option_name LIKE %s AND option_value LIKE %s",
'_transient_oembed_%',
'%fbtrace_id%'
)
);
foreach ( $transient_options as $value ) {
$option_name = $value->option_name;
delete_option( $option_name );
// find the _transient_timeout_oembed_* options and delete them.
$option_key = substr( $option_name, 18 );
$timeout_key = '_transient_timeout_oembed_' . $option_key;
$timeout_value = get_option( $timeout_key );
if ( is_numeric( $timeout_value ) ) {
delete_option( $timeout_key );
}
}
// get _oembed_* options from wp_postmeta.
$postmeta_table = $wpdb->prefix . 'postmeta';
$oembed_options = $wpdb->get_results(
$wpdb->prepare(
"SELECT post_id, meta_key, meta_value FROM $postmeta_table WHERE meta_key LIKE %s AND meta_value LIKE %s",
'_oembed_%',
'{{unknown}}'
)
);
foreach ( $oembed_options as $value ) {
$post_id = $value->post_id;
$meta_key = $value->meta_key;
$meta_value = $value->meta_value;
$meta_value = maybe_unserialize( $meta_value );
delete_post_meta( $post_id, $meta_key );
// get the cache key.
$cache_key = substr( $meta_key, 8 );
$cache_meta_key = '_oembed_time_' . $cache_key;
$cache_meta_value = get_post_meta( $post_id, $cache_meta_key, true );
if ( is_numeric( $cache_meta_value ) ) {
delete_post_meta( $post_id, $cache_meta_key );
}
}
}
/**
* Connection URLs are based on the website connecting accounts so that is
* configured here and returned
*
* @return string
*
* @since 4.0
*/
public static function get_connection_url() {
$admin_url_state = admin_url( 'admin.php?page=sbi-oembeds-manager' );
$nonce = wp_create_nonce('sbi_con');
//If the admin_url isn't returned correctly then use a fallback
if( $admin_url_state == '/wp-admin/admin.php?page=sbi-oembeds-manager' ){
$admin_url_state = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
}
return array(
'connect' => SBI_OEMBED_CONNECT_URL,
'sbi_con' => $nonce,
'stateURL' => $admin_url_state
);
}
/**
* Listener for retrieving and storing an access token for oEmbeds
*
* @param string $saved_access_token_data
*
* @return array|bool
*
* @since 4.0
*/
public static function maybe_connection_data( $saved_access_token_data ) {
$screen = get_current_screen();
if ( ! $screen ) {
return false;
}
if( ! isset( $_GET['page'] ) && 'sbi-oembeds-manager' !== $_GET['page'] ) {
return false;
}
global $sbi_notices;
$oembed_success_notice = $sbi_notices->get_notice('oembed_api_change_reconnect');
if ($oembed_success_notice) {
$sbi_notices->remove_notice('oembed_api_change_reconnect');
}
if ( ! empty( $_GET['transfer'] ) ) {
if ( class_exists( '\CustomFacebookFeed\CFF_Oembed' ) ) {
$cff_oembed_token = \CustomFacebookFeed\CFF_Oembed::last_access_token();
$return = get_option( 'cff_oembed_token', array() );
$return['access_token'] = $cff_oembed_token;
$return['disabled'] = false;
return $return;
}
}
if ( isset( $_GET['sbi_access_token'] ) ) {
$access_token = sbi_sanitize_alphanumeric_and_equals( $_GET['sbi_access_token'] );
$return = [];
$valid_new_access_token = ! empty( $access_token ) && strlen( $access_token ) > 20 && $saved_access_token_data !== $access_token ? $access_token : false;
if ( $valid_new_access_token ) {
$return['access_token'] = $valid_new_access_token;
$return['disabled'] = false;
$return['expiration_date'] = 'never';
$message = '' . __('oEmbed account successfully connected. You are all set to continue creating oEmbeds.', 'instagram-feed') . '
';
$success_args = array(
'class' => 'sbi-admin-notices',
'message' => $message,
'dismissible' => true,
'dismiss' => array(
'class' => 'sbi-notice-dismiss',
'icon' => SBI_PLUGIN_URL . 'admin/assets/img/sbi-dismiss-icon.svg',
'tag' => 'a',
'href' => '#',
),
'priority' => 1,
'page' => array(
'sbi-oembeds-manager',
),
'icon' => array(
'src' => SBI_PLUGIN_URL . 'admin/assets/img/sbi-exclamation.svg',
'wrap' => ' ',
),
'styles' => array(
'display' => 'flex',
'justify-content' => 'space-between',
'gap' => '2rem',
),
'wrap_schema' => '',
);
$sbi_notices->add_notice('oembed_api_change_reconnect', 'information', $success_args);
} else {
if ( $saved_access_token_data === $access_token ) {
$return['error'] = 'Not New';
} else {
$return['error'] = 'Not Valid';
}
}
return $return;
}
return false;
}
/**
* Check if Instagram oEmbed is enabled or not
*
* @return bool
*
* @since 4.0
*/
public function instagram_oembed_enabled() {
$sbi_oembed_token = get_option( 'sbi_oembed_token' );
if ( isset( $sbi_oembed_token['access_token'] ) && isset( $sbi_oembed_token['disabled'] ) && ! $sbi_oembed_token['disabled'] ) {
return true;
}
return false;
}
/**
* Check if Facebook oEmbed is enabled or not
*
* @return bool
*
* @since 4.0
*/
public function facebook_oembed_enabled() {
$cff_oembed_token = get_option( 'cff_oembed_token' );
if ( isset( $cff_oembed_token['access_token'] ) && isset( $cff_oembed_token['disabled'] ) && ! $cff_oembed_token['disabled'] ) {
return true;
}
return false;
}
/**
* Determines what action for Instagram should be done in the following order
* and returns data used in the common "addon" installer
*
* Free or Pro active, do nothing
* Pro installed but not active, activate Pro
* Free installed but not active, activate Free
* Nothing installed, install and activate Free
*
* @return array
*
* @since 4.0
*/
public static function facebook_installer_info() {
$all_plugins = get_plugins();
$active_plugins = get_option( 'active_plugins' );
if ( in_array( 'custom-facebook-feed/custom-facebook-feed.php', $active_plugins, true )
|| in_array( 'custom-facebook-feed-pro/custom-facebook-feed.php', $active_plugins, true ) ) {
return [
'nextStep' => 'none',
'plugin' => 'none',
'action' => 'none',
'referrer' => 'oembeds'
];
}
foreach ( $all_plugins as $plugin ) {
if ( strpos( $plugin['Name'], 'Custom Facebook Feed Pro' ) !== false ) {
return [
'nextStep' => 'pro_activate',
'plugin' => 'custom-facebook-feed-pro/custom-facebook-feed.php',
'action' => 'sbi_activate_addon',
'referrer' => 'oembeds'
];
}
if ( strpos( $plugin['Name'], 'Custom Facebook Feed' ) !== false ) {
return [
'nextStep' => 'free_activate',
'plugin' => 'custom-facebook-feed/custom-facebook-feed.php',
'action' => 'sbi_activate_addon',
'referrer' => 'oembeds'
];
}
}
return [
'nextStep' => 'free_install',
'plugin' => 'https://downloads.wordpress.org/plugin/custom-facebook-feed.zip',
'action' => 'sbi_install_addon',
'referrer' => 'oembeds'
];
}
/**
* oEmbeds Manager Page View Template
*
* @since 4.0
*/
public function oembeds_manager(){
\InstagramFeed\SBI_View::render( 'oembeds.index' );
}
}
PK L\C . instagram-feed/admin/views/oembeds/content.phpnu [
{{genericText.instagramOEmbedsEnabled}}
{{genericText.instagramOEmbeds}}
{{genericText.disable}}
{{genericText.enable}}
{{genericText.facebookOEmbedsEnabled}}
{{genericText.facebookOEmbeds}}
{{genericText.disable}}
{{genericText.enable}}
PK L\F*q q , instagram-feed/admin/views/oembeds/index.phpnu [
PK L\/g g , instagram-feed/admin/views/oembeds/modal.phpnu [
{{modal.title}}
{{modal.description}}
{{modal.cancel}}
PK L\Hm 6 instagram-feed/admin/views/oembeds/oembed_features.phpnu [
{{genericText.whenYouPaste}}
{{genericText.dueToRecent}}
{{genericText.however}}
{{genericText.justEnable}}
PK L\86p p 2 instagram-feed/admin/views/oembeds/plugin_info.phpnu [
{{genericText.displayACompletely}}
{{genericText.createACustom}}
PK L\2 2 , instagram-feed/admin/views/about/content.phpnu [
{{aboutBox.atSmashBalloon}}
{{aboutBox.weAreOn}}
{{aboutBox.ourPlugins}}
{{plugin.title}}
{{plugin.description}}
{{buttons.install}}
{{buttons.installed}}
{{buttons.activate}}
{{buttons.deactivate}}
{{social_wall.title}}
{{social_wall.description}}
{{plugin.title}}
{{plugin.description}}
{{buttons.install}}
{{buttons.installed}}
{{buttons.activate}}
{{buttons.deactivate}}
PK L\2k k * instagram-feed/admin/views/about/index.phpnu [
PK L\%^ : instagram-feed/admin/views/sections/builder_footer_cta.phpnu [
{{genericText.getMoreFeatures}}
{{genericText.ctaHashtag}}
{{genericText.ctaLayout}}
{{genericText.ctaPopups}}
{{genericText.ctaFilter}}
{{genericText.andMuchMore}}
{{genericText.ctaShowFeatures}}
{{genericText.ctaHideFeatures}}
PK L\ ; instagram-feed/admin/views/sections/settings_footer_cta.phpnu [
{{genericText.getMoreFeatures}}
{{genericText.liteFeedUsersAutoApply}}
{{genericText.ctaHashtag}}
{{genericText.ctaLayout}}
{{genericText.ctaPopups}}
{{genericText.ctaFilter}}
{{genericText.andMuchMore}}
PK L\Z3) 3) . instagram-feed/admin/views/sections/header.phpnu [
PK L\W 5 instagram-feed/admin/views/sections/sticky_widget.phpnu [
PK L\O|
/ instagram-feed/admin/views/settings/content.phpnu [
PK L\ - instagram-feed/admin/views/settings/index.phpnu [
PK L\a$ 1 instagram-feed/admin/views/settings/tab/feeds.phpnu [
{{feedsTab.cachingBox.title}}
{{feedsTab.gdprBox.title}}
{{feedsTab.customCSSBox.title}}
{{feedsTab.customJSBox.title}}
PK L\Ͽ* * 4 instagram-feed/admin/views/settings/tab/advanced.phpnu [
{{advancedTab.optimizeBox.title}}
{{advancedTab.legacyCSSBox.title}}
{{advancedTab.ajaxBox.title}}
{{advancedTab.resetErrorBox.title}}
{{advancedTab.resetErrorBox.reset}}
{{advancedTab.resetErrorBox.helpText}}
{{advancedTab.usageBox.title}}
{{advancedTab.ajaxInitial.title}}
{{advancedTab.enqueueHead.title}}
{{advancedTab.enqueueShortcode.title}}
{{advancedTab.jsImages.title}}
{{advancedTab.adminErrorBox.title}}
{{advancedTab.feedIssueBox.title}}
{{advancedTab.dpaClear.title}}
{{advancedTab.dpaClear.clear}}
{{advancedTab.dpaClear.helpText}}
PK L\H H 3 instagram-feed/admin/views/settings/tab/general.phpnu [
{{generalTab.uoInstallNotice.notice}}
{{generalTab.uoInstallNotice.learnMore}}
{{generalTab.licenseBox.title}}
{{generalTab.licenseBox.description}}
{{generalTab.manageSource.title}}
{{generalTab.preserveBox.title}}
{{generalTab.importBox.title}}
{{generalTab.exportBox.title}}
PK L\10"}/ / . instagram-feed/admin/views/support/content.phpnu [
{{genericText.gettingStarted}}
{{genericText.someHelpful}}
{{genericText.docsN}}
{{genericText.runInto}}
{{genericText.additionalR}}
{{genericText.toHelp}}
{{genericText.newTempHeading}}
{{genericText.newTempDesc}}
{{genericText.newTempButton}}
{{genericText.learnMore}}
{{genericText.tempLoginHeading}}
{{genericText.tempLoginDesc}}
{{genericText.link}}
{{genericText.expires}}
{{tempUser.url}}
{{tempUser.expires_date + ' ' + ( parseInt(tempUser.expires_date) <= 1 ? genericText.day : genericText.days)}}
{{genericText.delete}}
{{genericText.copyLink}}
PK L\q q , instagram-feed/admin/views/support/index.phpnu [
PK L\ 4 instagram-feed/admin/views/support/support-tools.phpnu [
init();
}
/**
* Determining if the user is viewing the our page, if so, party on.
*
* @since 4.0
*/
public function init() {
if ( ! is_admin() ) {
return;
}
add_action( 'in_admin_header', [ $this, 'remove_admin_notices' ] );
add_action( 'wp_ajax_sbi_check_license', [ $this, 'sbi_check_license' ] );
add_action( 'sbi_header_notices', array( $this, 'header_notices' ) );
add_action( 'wp_ajax_sbi_dismiss_upgrade_notice', array( $this, 'dismiss_upgrade_notice' ) );
add_action( 'admin_init', array( $this, 'sbi_admin_notices' ) );
add_action( 'sb_notice_custom_feed_templates_dismissed', array( $this, 'sbi_dismiss_notice' ) );
}
/**
* Header Notices
*
* @since 6.0
*/
public function header_notices() {
$lite_notice_dismissed = get_transient( 'instagram_feed_dismiss_lite' );
if ( $lite_notice_dismissed ) {
return;
}
$output = '';
$upgrade_url = 'https://smashballoon.com/instagram-feed/demo/?utm_campaign=instagram-free&utm_source=lite-upgrade-bar';
$output .= '';
echo $output;
}
/**
* Dismiss Upgrade Notice
*
* @since 6.0
*
* @return SBI_Response
*/
public function dismiss_upgrade_notice() {
// Run a security check.
check_ajax_referer( 'sbi_nonce' , 'sbi_nonce');
$cap = current_user_can( 'manage_instagram_feed_options' ) ? 'manage_instagram_feed_options' : 'manage_options';
$cap = apply_filters( 'sbi_settings_pages_capability', $cap );
if ( ! current_user_can( $cap ) ) {
wp_send_json_error(); // This auto-dies.
}
// set the transient so it will hide for next 7 days
set_transient( 'instagram_feed_dismiss_lite', 'dismiss', 1 * WEEK_IN_SECONDS );
$response = new SBI_Response( true, array() );
$response->send();
}
/**
* Remove admin notices from inside our plugin screens so we can show our customized notices
*
* @since 4.0
*/
public function remove_admin_notices() {
$current_screen = get_current_screen();
$not_allowed_screens = array(
'instagram-feed_page_sbi-feed-builder',
'instagram-feed_page_sbi-settings',
'instagram-feed_page_sbi-oembeds-manager',
'instagram-feed_page_sbi-extensions-manager',
'instagram-feed_page_sbi-about-us',
'instagram-feed_page_sbi-support',
);
if ( in_array( $current_screen->base, $not_allowed_screens ) || strpos( $current_screen->base, 'sbi-' ) !== false ) {
remove_all_actions('admin_notices');
remove_all_actions('all_admin_notices');
}
}
/**
* CFF Get Renew License URL
*
* @since 4.0
*
* @return string $url
*/
public function get_renew_url() {
global $sbi_download_id;
$license_key = get_option( 'sbi_license_key' ) ? get_option( 'sbi_license_key' ) : null;
$url = sprintf(
'https://smashballoon.com/checkout/?edd_license_key=%s&download_id=%s&utm_campaign=instagram-free&utm_source=expired-notice&utm_medium=renew-license',
$license_key,
$sbi_download_id
);
return $url;
}
/**
* CFF Check License
*
* @since 4.0
*
* @return SBI_Response
*/
public function sbi_check_license() {
// Run a security check.
check_ajax_referer( 'sbi_nonce' , 'sbi_nonce');
$cap = current_user_can( 'manage_instagram_feed_options' ) ? 'manage_instagram_feed_options' : 'manage_options';
$cap = apply_filters( 'sbi_settings_pages_capability', $cap );
if ( ! current_user_can( $cap ) ) {
wp_send_json_error(); // This auto-dies.
}
$sbi_license = trim( get_option( 'sbi_license_key' ) );
// Check the API
$sbi_api_params = array(
'edd_action'=> 'check_license',
'nocache' => '1',
'license' => $sbi_license,
'item_name' => urlencode( SBI_PLUGIN_NAME ) // the name of our product in EDD
);
$sbi_response = wp_remote_get( add_query_arg( $sbi_api_params, SBI_STORE_URL ), array( 'timeout' => 60 ) );
$sbi_license_data = (array) json_decode( wp_remote_retrieve_body( $sbi_response ) );
// Update the updated license data
update_option( 'sbi_license_data', $sbi_license_data );
$sbi_todays_date = date('Y-m-d');
// Check whether it's active
if( $sbi_license_data['license'] !== 'expired' && ( strtotime( $sbi_license_data['expires'] ) > strtotime($sbi_todays_date) ) ) {
// if the license is active then lets remove the ignore check for dashboard so next time it will show the expired notice in dashboard screen
update_user_meta( get_current_user_id(), 'sbi_ignore_dashboard_license_notice', false );
$response = new SBI_Response( true, array(
'msg' => 'License Active',
'content' => $this->get_renewed_license_notice_content()
) );
$response->send();
} else {
$content = 'Your Instagram Feed Pro license key has expired';
$response = new SBI_Response( false, array(
'msg' => 'License Not Renewed',
'content' => $content
) );
$response->send();
}
}
/**
* Get content for successfully renewed license notice
*
* @since 4.0
*
* @return string $output
*/
public function get_renewed_license_notice_content() {
$output = '
Thanks! Your license key is valid.
You can safely dismiss this modal.
';
return $output;
}
/**
* Get modal content that will trigger by "Why Renew" button
*
* @since 4.0
*
* @return string $output
*/
public function get_modal_content() {
$output = '
Why Renew?
See below for why it\'s so important to keep an active plugin license.
Protected Against All Upcoming Instagram Platform Updates and API Changes
Don\'t worry about your Instagram feeds breaking due to constant changes in the Instagram platform. Stay protected with access to continual plugin updates, giving you peace of mind that the software will always be up to date.
Expert Technical Support
Without a valid license key you will no longer be able to receive updates or support for the Instagram Feed plugin. A renewed license key grants you access to our top-notch, quick and effective support for another full year.
WordPress Compatibility Updates
With WordPress updates being released continually, we make sure the plugin is always compatible with the latest version so you can update WordPress without needing to worry.
All Pro Instagram Feed Features
Photos & Albums, Videos (HD, 360, Live), Instagram Events, Popup Lightbox, Likes, Shares, & Reactions, Comments and Replies, Filter Posts, Post Layouts, Load More Posts, Multi-column Grid Layout, Background Caching, and more!
';
return $output;
}
/**
* Display admin notices in the plugin's pages
*
* @since 6.3
*/
public function sbi_admin_notices() {
$allowed_screens = array(
'sbi-feed-builder',
'sbi-settings',
'sbi-oembeds-manager',
'sbi-extensions-manager',
'sbi-about-us',
'sbi-support',
);
$current_screen = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
$is_allowed = in_array( $current_screen, $allowed_screens );
// We will display the notice only on those allowed screens.
if ( ! $current_screen || ! $is_allowed ) {
return;
}
// Only display notice to admins.
if( !sbi_current_user_can( 'manage_instagram_feed_options' ) ){
return;
}
$has_custom_templates = Util::sbi_has_custom_templates();
$sbi_statuses = get_option( 'sbi_statuses', array() );
if ( ! $has_custom_templates ) {
$sbi_statuses['custom_templates_notice'] = true;
update_option( 'sbi_statuses', $sbi_statuses );
return;
}
if ( true == get_option( 'sbi_custom_templates_notice_dismissed' ) || isset( $sbi_statuses['custom_templates_notice'] ) ) {
return;
}
global $sbi_notices;
$title = __( 'Heads Up! Feed Item Files and CSS Have Changed', 'instagram-feed' );
$message = '' . __( 'Version 6.3 includes changes to the HTML and CSS files that make up your feeds. If you have customized your feed through custom theme templates, custom CSS, or custom JavaScript, your customizations may have been affected.', 'instagram-feed' ) . '
';
$message .= '' . __( 'You can use the CSS file from previous versions if needed. Enable the related setting on the Advanced tab of the settings page.', 'instagram-feed' ) . '
';
$error_args = array(
'class' => 'sbi-admin-notices sbi-admin-notices-spaced-p',
'title' => array(
'text' => $title,
'class' => 'sb-notice-title',
'tag' => 'h4',
),
'message' => $message,
'dismissible' => true,
'dismiss' => array(
'class' => 'sbi-notice-dismiss',
'icon' => SBI_PLUGIN_URL . 'admin/assets/img/sbi-dismiss-icon.svg',
'tag' => 'a',
'href' => array(
'args' => array(
'sb-dismiss-notice' => 'custom_feed_templates'
),
'action' => 'sb_dismiss_notice_nonce',
'nonce' => '_sb_notice_nonce',
)
),
'buttons' => array(
array(
'text' => __('Sounds good!', 'instagram-feed'),
'class' => 'button button-primary',
'id' => 'custom_feed_templates_dismiss',
'url' => array(
'args' => array(
'sb-dismiss-notice' => 'custom_feed_templates'
),
'action' => 'sb_dismiss_notice_nonce',
'nonce' => '_sb_notice_nonce',
),
'tag' => 'a',
),
array(
'text' => __('Learn More', 'instagram-feed'),
'class' => 'button button-secondary',
'id' => 'custom_feed_templates_learn',
'url' => 'https://smashballoon.com/doc/instagram-css-layout-changes/?utm_source=instagram-pro&utm_medium=dashboard-notice&utm_campaign=63changes&utm_content=LearnMore',
'target' => 'blank',
'tag' => 'a',
),
),
'buttons_wrap_start' => '',
'buttons_wrap_end' => '
',
'priority' => 1,
'page' => array(
'sbi-feed-builder',
'sbi-settings',
'sbi-oembeds-manager',
'sbi-extensions-manager',
'sbi-about-us',
'sbi-support',
),
'icon' => array(
'src' => SBI_PLUGIN_URL . 'admin/assets/img/balloon.svg',
'wrap' => ' ',
),
'wrap_schema' => '{icon}
{title}{message}
{dismiss}{buttons}
',
);
$sbi_notices->add_notice( 'custom_feed_templates', 'information', $error_args );
$sbi_statuses['custom_templates_notice'] = true;
update_option( 'sbi_statuses', $sbi_statuses );
}
/**
* Dismiss custom feeds template admin notices
*
* @since 6.3
*/
public function sbi_dismiss_notice( $notice_id ) {
if ( 'custom_feed_templates' === $notice_id ) {
update_option( 'sbi_custom_templates_notice_dismissed', true );
}
}
}
PK L\c6 ! instagram-feed/admin/SBI_View.phpnu [ 'Afrikaans',
'ar_AR' => 'Arabic',
'az_AZ' => 'Azerbaijani',
'be_BY' => 'Belarusian',
'bg_BG' => 'Bulgarian',
'bn_IN' => 'Bengali',
'bs_BA' => 'Bosnian',
'ca_ES' => 'Catalan',
'cs_CZ' => 'Czech',
'cy_GB' => 'Welsh',
'da_DK' => 'Danish',
'de_DE' => 'German',
'el_GR' => 'Greek',
'en_GB' => 'English (UK',
'en_PI' => 'English (Pirate)',
'en_US' => 'English (US)',
'eo_EO' => 'Esperanto',
'es_ES' => 'Spanish (Spain)',
'es_LA' => 'Spanish',
'et_EE' => 'Estonian',
'eu_ES' => 'Basque',
'fa_IR' => 'Persian',
'fb_LT' => 'Leet Speak',
'fi_FI' => 'Finnish',
'fo_FO' => 'Faroese',
'fr_CA' => 'French (Canada)',
'fr_FR' => 'French (France)',
'fy_NL' => 'Frisian',
'ga_IE' => 'Irish',
'gl_ES' => 'Galician',
'he_IL' => 'Hebrew',
'hi_IN' => 'Hindi',
'hr_HR' => 'Croatian',
'hu_HU' => 'Hungarian',
'hy_AM' => 'Armenian',
'id_ID' => 'Indonesian',
'is_IS' => 'Icelandic',
'it_IT' => 'Italian',
'ja_JP' => 'Japanese',
'ka_GE' => 'Georgian',
'km_KH' => 'Khmer',
'ko_KR' => 'Korean',
'ku_TR' => 'Kurdish',
'la_VA' => 'Latin',
'lt_LT' => 'Lithuanian',
'lv_LV' => 'Latvian',
'mk_MK' => 'Macedonian',
'ml_IN' => 'Malayalam',
'ms_MY' => 'Malay',
'nb_NO' => 'Norwegian (bokmal)',
'ne_NP' => 'Nepali',
'nl_NL' => 'Dutch',
'nn_NO' => 'Norwegian (nynorsk)',
'pa_IN' => 'Punjabi',
'pl_PL' => 'Polish',
'ps_AF' => 'Pashto',
'pt_BR' => 'Portuguese (Brazil)',
'pt_PT' => 'Portuguese (Portugal)',
'ro_RO' => 'Romanian',
'ru_RU' => 'Russian',
'sk_SK' => 'Slovak',
'sl_SI' => 'Slovenian',
'sq_AL' => 'Albanian',
'sr_RS' => 'Serbian',
'sv_SE' => 'Swedish',
'sw_KE' => 'Swahili',
'ta_IN' => 'Tamil',
'te_IN' => 'Telugu',
'th_TH' => 'Thai',
'tl_PH' => 'Filipino',
'tr_TR' => 'Turkish',
'uk_UA' => 'Ukrainian',
'vi_VN' => 'Vietnamese',
'zh_CN' => 'Simplified Chinese (China)',
'zh_HK' => 'Traditional Chinese (Hong Kong)',
'zh_TW' => 'Traditional Chinese (Taiwan)',
);
}
/**
* Return the timezones
*
* @since 4.0
*
* @return array
*/
public static function timezones() {
return array(
'Pacific/Midway' => '(GMT-11:00) Midway Island, Samoa',
'America/Adak' => '(GMT-10:00) Hawaii-Aleutian',
'Etc/GMT+10' => '(GMT-10:00) Hawaii',
'Pacific/Marquesas' => '(GMT-09:30) Marquesas Islands',
'Pacific/Gambier' => '(GMT-09:00) Gambier Islands',
'America/Anchorage' => '(GMT-09:00) Alaska',
'America/Ensenada' => '(GMT-08:00) Tijuana, Baja California',
'Etc/GMT+8' => '(GMT-08:00) Pitcairn Islands',
'America/Los_Angeles' => '(GMT-08:00) Pacific Time (US & Canada',
'America/Denver' => '(GMT-07:00) Mountain Time (US & Canada',
'America/Chihuahua' => '(GMT-07:00) Chihuahua, La Paz, Mazatlan',
'America/Dawson_Creek' => '(GMT-07:00) Arizona',
'America/Belize' => '(GMT-06:00) Saskatchewan, Central America',
'America/Cancun' => '(GMT-06:00) Guadalajara, Mexico City, Monterrey',
'Chile/EasterIsland' => '(GMT-06:00) Easter Island',
'America/Chicago' => '(GMT-06:00) Central Time (US & Canada)',
'America/New_York' => '(GMT-05:00) Eastern Time (US & Canada)',
'America/Havana' => '(GMT-05:00) Cuba',
'America/Bogota' => '(GMT-05:00) Bogota, Lima, Quito, Rio Branco',
'America/Caracas' => '(GMT-04:30) Caracas',
'America/Santiago' => '(GMT-04:00) Santiago',
'America/La_Paz' => '(GMT-04:00) La Paz',
'Atlantic/Stanley' => '(GMT-04:00) Faukland Islands',
'America/Campo_Grande' => '(GMT-04:00) Brazil',
'America/Goose_Bay' => '(GMT-04:00) Atlantic Time (Goose Bay)',
'America/Glace_Bay' => '(GMT-04:00) Atlantic Time (Canada)',
'America/St_Johns' => '(GMT-03:30) Newfoundland',
'America/Araguaina' => '(GMT-03:00) UTC-3',
'America/Montevideo' => '(GMT-03:00) Montevideo',
'America/Miquelon' => '(GMT-03:00) Miquelon, St. Pierre',
'America/Godthab' => '(GMT-03:00) Greenland',
'America/Argentina/Buenos_Aires' => '(GMT-03:00) Buenos Aires',
'America/Sao_Paulo' => '(GMT-03:00) Brasilia',
'America/Noronha' => '(GMT-02:00) Mid-Atlantic',
'Atlantic/Cape_Verde' => '(GMT-01:00) Cape Verde Is',
'Atlantic/Azores' => '(GMT-01:00) Azores',
'Europe/Belfast' => '(GMT) Greenwich Mean Time : Belfast',
'Europe/Dublin' => '(GMT) Greenwich Mean Time : Dublin',
'Europe/Lisbon' => '(GMT) Greenwich Mean Time : Lisbon',
'Europe/London' => '(GMT) Greenwich Mean Time : London',
'Africa/Abidjan' => '(GMT) Monrovia, Reykjavik',
'Europe/Amsterdam' => '(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna',
'Europe/Belgrade' => '(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague',
'Europe/Brussels' => '(GMT+01:00) Brussels, Copenhagen, Madrid, Paris',
'Africa/Algiers' => '(GMT+01:00) West Central Africa',
'Africa/Windhoek' => '(GMT+01:00) Windhoek',
'Asia/Beirut' => '(GMT+02:00) Beirut',
'Africa/Cairo' => '(GMT+02:00) Cairo',
'Asia/Gaza' => '(GMT+02:00) Gaza',
'Africa/Blantyre' => '(GMT+02:00) Harare, Pretoria',
'Asia/Jerusalem' => '(GMT+02:00) Jerusalem',
'Europe/Helsinki' => '(GMT+02:00) Helsinki',
'Europe/Minsk' => '(GMT+02:00) Minsk',
'Asia/Damascus' => '(GMT+02:00) Syria',
'Europe/Moscow' => '(GMT+03:00) Moscow, St. Petersburg, Volgograd',
'Africa/Addis_Ababa' => '(GMT+03:00) Nairobi',
'Asia/Tehran' => '(GMT+03:30) Tehran',
'Asia/Dubai' => '(GMT+04:00) Abu Dhabi, Muscat',
'Asia/Yerevan' => '(GMT+04:00) Yerevan',
'Asia/Kabul' => '(GMT+04:30) Kabul',
'Asia/Yekaterinburg' => '(GMT+05:00) Ekaterinburg',
'Asia/Tashkent' => '(GMT+05:00) Tashkent',
'Asia/Kolkata' => '(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi',
'Asia/Katmandu' => '(GMT+05:45) Kathmandu',
'Asia/Dhaka' => '(GMT+06:00) Astana, Dhaka',
'Asia/Novosibirsk' => '(GMT+06:00) Novosibirsk',
'Asia/Rangoon' => '(GMT+06:30) Yangon (Rangoon',
'Asia/Bangkok' => '(GMT+07:00) Bangkok, Hanoi, Jakarta',
'Asia/Krasnoyarsk' => '(GMT+07:00) Krasnoyarsk',
'Asia/Hong_Kong' => '(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi',
'Asia/Irkutsk' => '(GMT+08:00) Irkutsk, Ulaan Bataar',
'Australia/Perth' => '(GMT+08:00) Perth',
'Australia/Eucla' => '(GMT+08:45) Eucla',
'Asia/Tokyo' => '(GMT+09:00) Osaka, Sapporo, Tokyo',
'Asia/Seoul' => '(GMT+09:00) Seoul',
'Asia/Yakutsk' => '(GMT+09:00) Yakutsk',
'Australia/Adelaide' => '(GMT+09:30) Adelaide',
'Australia/Darwin' => '(GMT+09:30) Darwin',
'Australia/Brisbane' => '(GMT+10:00) Brisbane',
'Australia/Hobart' => '(GMT+10:00) Sydney',
'Asia/Vladivostok' => '(GMT+10:00) Vladivostok',
'Australia/Lord_Howe' => '(GMT+10:30) Lord Howe Island',
'Etc/GMT-11' => '(GMT+11:00) Solomon Is., New Caledonia',
'Asia/Magadan' => '(GMT+11:00) Magadan',
'Pacific/Norfolk' => '(GMT+11:30) Norfolk Island',
'Asia/Anadyr' => '(GMT+12:00) Anadyr, Kamchatka',
'Pacific/Auckland' => '(GMT+12:00) Auckland, Wellington',
'Etc/GMT-12' => 'GMT+12:00) Fiji, Kamchatka, Marshall Is',
'Pacific/Chatham' => '(GMT+12:45) Chatham Islands',
'Pacific/Tongatapu' => '(GMT+13:00) Nuku\'alofa',
'Pacific/Kiritimati' => '(GMT+14:00) Kiritimati'
);
}
}PK L\2t38 8 , instagram-feed/admin/SBI_Global_Settings.phpnu [ init();
}
/**
* Determining if the user is viewing the our page, if so, party on.
*
* @since 6.0
*/
public function init() {
if ( ! is_admin() ) {
return;
}
add_action('admin_menu', [$this, 'register_menu']);
add_filter( 'admin_footer_text', [$this, 'remove_admin_footer_text'] );
add_action( 'wp_ajax_sbi_save_settings', [$this, 'sbi_save_settings'] );
add_action( 'wp_ajax_sbi_activate_license', [$this, 'sbi_activate_license'] );
add_action( 'wp_ajax_sbi_deactivate_license', [$this, 'sbi_deactivate_license'] );
add_action( 'wp_ajax_sbi_test_connection', [$this, 'sbi_test_connection'] );
add_action( 'wp_ajax_sbi_recheck_connection', [$this, 'sbi_recheck_connection'] );
add_action( 'wp_ajax_sbi_import_settings_json', [$this, 'sbi_import_settings_json'] );
add_action( 'wp_ajax_sbi_export_settings_json', [$this, 'sbi_export_settings_json'] );
add_action( 'wp_ajax_sbi_clear_cache', [$this, 'sbi_clear_cache'] );
add_action( 'wp_ajax_sbi_clear_image_resize_cache', [$this, 'sbi_clear_image_resize_cache'] );
add_action( 'wp_ajax_sbi_clear_error_log', [$this, 'sbi_clear_error_log'] );
add_action( 'wp_ajax_sbi_retry_db', [$this, 'sbi_retry_db'] );
add_action( 'wp_ajax_sbi_dpa_reset', [$this, 'sbi_dpa_reset'] );
}
/**
* SBI Save Settings
*
* This will save the data fron the settings page
*
* @since 6.0
*
* @return SBI_Response
*/
public function sbi_save_settings() {
check_ajax_referer( 'sbi-admin', 'nonce' );
if ( ! sbi_current_user_can( 'manage_instagram_feed_options' ) ) {
wp_send_json_error();
}
$data = $_POST;
$model = isset( $data[ 'model' ] ) ? $data['model'] : null;
// return if the model is null
if ( null === $model ) {
return;
}
// get the sbi license key and extensions license key
$sbi_license_key = sanitize_text_field( $_POST['sbi_license_key'] );
// Only update the sbi_license_key value when it's inactive
if ( get_option( 'sbi_license_status') == 'inactive' ) {
if ( empty( $sbi_license_key ) || strlen( $sbi_license_key ) < 1 ) {
delete_option( 'sbi_license_key' );
delete_option( 'sbi_license_data' );
delete_option( 'sbi_license_status' );
} else {
update_option( 'sbi_license_key', $sbi_license_key );
}
} else {
$license_key = sanitize_key( trim( get_option( 'sbi_license_key', '' ) ) );
if ( empty( $sbi_license_key ) && ! empty( $license_key ) ) {
$sbi_license_data = $this->get_license_data( $license_key, 'deactivate_license', SBI_PLUGIN_NAME );
delete_option( 'sbi_license_key' );
delete_option( 'sbi_license_data' );
delete_option( 'sbi_license_status' );
}
}
$model = (array) \json_decode( \stripslashes( $model ) );
$general = (array) $model['general'];
$feeds = (array) $model['feeds'];
$advanced = (array) $model['advanced'];
// Get the values and sanitize
$sbi_settings = get_option( 'sb_instagram_settings', array() );
/**
* General Tab
*/
$sbi_settings['sb_instagram_preserve_settings'] = $general['preserveSettings'];
/**
* Feeds Tab
*/
if ( current_user_can( 'unfiltered_html' ) ) {
$sbi_settings['sb_instagram_custom_css'] = $feeds['customCSS'];
$sbi_settings['sb_instagram_custom_js'] = $feeds['customJS'];
}
$sbi_settings['gdpr'] = sanitize_text_field( $feeds['gdpr'] );
$sbi_settings['sbi_cache_cron_interval'] = sanitize_text_field( $feeds['cronInterval'] );
$sbi_settings['sbi_cache_cron_time'] = sanitize_text_field( $feeds['cronTime'] );
$sbi_settings['sbi_cache_cron_am_pm'] = sanitize_text_field( $feeds['cronAmPm'] );
/**
* Advanced Tab
*/
$sbi_settings['sb_instagram_ajax_theme'] = sanitize_text_field( $advanced['sbi_ajax'] );
$sbi_settings['sb_instagram_disable_resize'] = !(bool)$advanced['sbi_enable_resize'];
$sbi_settings['image_format'] = sanitize_text_field($advanced['image_format']);
$sbi_settings['sb_ajax_initial'] = (bool)$advanced['sb_ajax_initial'];
$sbi_settings['enqueue_js_in_head'] = (bool)$advanced['sbi_enqueue_js_in_head'];
$sbi_settings['enqueue_css_in_shortcode'] = (bool)$advanced['sbi_enqueue_css_in_shortcode'];
$sbi_settings['disable_js_image_loading'] = !(bool)$advanced['sbi_enable_js_image_loading'];
$sbi_settings['disable_admin_notice'] = !(bool)$advanced['enable_admin_notice'];
$sbi_settings['enable_email_report'] = (bool)$advanced['enable_email_report'];
$sbi_settings['enqueue_legacy_css'] = (bool) $advanced['enqueue_legacy_css'];
$sbi_settings['email_notification'] = sanitize_text_field( $advanced['email_notification'] );
$sbi_settings['email_notification_addresses'] = sanitize_text_field( $advanced['email_notification_addresses'] );
$usage_tracking = get_option( 'sbi_usage_tracking', array( 'last_send' => 0, 'enabled' => sbi_is_pro_version() ) );
if ( isset( $advanced['email_notification_addresses'] ) ) {
$usage_tracking['enabled'] = false;
if ( isset( $advanced['usage_tracking'] ) ) {
if ( ! is_array( $usage_tracking ) ) {
$usage_tracking = array(
'enabled' => $advanced['usage_tracking'],
'last_send' => 0,
);
} else {
$usage_tracking['enabled'] = $advanced['usage_tracking'];
}
}
update_option( 'sbi_usage_tracking', $usage_tracking, false );
}
// Update the sbi_style_settings option that contains data for translation and advanced tabs
update_option( 'sb_instagram_settings', $sbi_settings );
// clear cron caches
$this->sbi_clear_cache();
$response = new SBI_Response( true, array(
'cronNextCheck' => $this->get_cron_next_check()
) );
$response->send();
}
/**
* SBI Activate License Key
*
* @since 6.0
*
* @return SBI_Response
*/
public function sbi_activate_license() {
check_ajax_referer( 'sbi-admin', 'nonce' );
if ( ! sbi_current_user_can( 'manage_instagram_feed_options' ) ) {
wp_send_json_error();
}
// do the form validation to check if license_key is not empty
if ( empty( $_POST[ 'license_key' ] ) ) {
$response = new \InstagramFeed\SBI_Response( false, array(
'message' => __( 'License key required!', 'instagram-feed' ),
) );
$response->send();
}
$license_key = sanitize_key( $_POST[ 'license_key' ] );
// make the remote api call and get license data
$sbi_license_data = $this->get_license_data( $license_key, 'activate_license', SBI_PLUGIN_NAME );
// update the license data
if( !empty( $sbi_license_data ) ) {
update_option( 'sbi_license_data', $sbi_license_data );
}
// update the licnese key only when the license status is activated
update_option( 'sbi_license_key', $license_key );
// update the license status
update_option( 'sbi_license_status', $sbi_license_data['license'] );
// Check if there is any error in the license key then handle it
$sbi_license_data = $this->get_license_error_message( $sbi_license_data );
// Send ajax response back to client end
$data = array(
'licenseStatus' => $sbi_license_data['license'],
'licenseData' => $sbi_license_data
);
$response = new SBI_Response( true, $data );
$response->send();
}
/**
* SBI Deactivate License Key
*
* @since 6.0
*
* @return SBI_Response
*/
public function sbi_deactivate_license() {
check_ajax_referer( 'sbi-admin', 'nonce' );
if ( ! sbi_current_user_can( 'manage_instagram_feed_options' ) ) {
wp_send_json_error();
}
$license_key = sanitize_key( trim( get_option( 'sbi_license_key', '' ) ) );
$sbi_license_data = $this->get_license_data( $license_key, 'deactivate_license', SBI_PLUGIN_NAME );
// update the license data
if( !empty( $sbi_license_data ) ) {
update_option( 'sbi_license_data', $sbi_license_data );
}
if ( ! $sbi_license_data['success'] ) {
$response = new SBI_Response( false, array() );
$response->send();
}
// remove the license keys and update license key status
if( $sbi_license_data['license'] == 'deactivated' ) {
update_option( 'sbi_license_status', 'inactive' );
$data = array(
'licenseStatus' => 'inactive'
);
$response = new SBI_Response( true, $data );
$response->send();
}
}
/**
* SBI Test Connection
*
* @since 6.0
*
* @return SBI_Response
*/
public function sbi_test_connection() {
check_ajax_referer( 'sbi-admin', 'nonce' );
if ( ! sbi_current_user_can( 'manage_instagram_feed_options' ) ) {
wp_send_json_error();
}
$license_key = sanitize_key( get_option( 'sbi_license_key', '' ) );
$sbi_api_params = array(
'edd_action'=> 'check_license',
'license' => $license_key,
'item_name' => urlencode( SBI_PLUGIN_NAME ) // the name of our product in EDD
);
$url = add_query_arg( $sbi_api_params, SBI_STORE_URL );
$args = array(
'timeout' => 60,
'sslverify' => false
);
// Make the remote API request
$request = \InstagramFeed\SBI_HTTP_Request::request( 'GET', $url, $args );
if ( \InstagramFeed\SBI_HTTP_Request::is_error( $request ) ) {
$message = '';
foreach ( $request->errors as $key => $error ) {
$message .= esc_html( $key ) . ' - ' . esc_html( $error[0] );
}
$response = new SBI_Response( false, array(
'hasError' => true,
'error' => $message
) );
$response->send();
}
$response = new SBI_Response( true, array(
'hasError' => false
) );
$response->send();
}
/**
* SBI Re-Check License
*
* @since 6.0
*
* @return SBI_Response
*/
public function sbi_recheck_connection() {
check_ajax_referer( 'sbi-admin', 'nonce' );
if ( ! sbi_current_user_can( 'manage_instagram_feed_options' ) ) {
wp_send_json_error();
}
// Do the form validation
$license_key = isset( $_POST['license_key'] ) ? sanitize_key( $_POST['license_key'] ) : '';
$item_name = isset( $_POST['item_name'] ) ? sanitize_text_field( $_POST['item_name'] ) : '';
$option_name = isset( $_POST['option_name'] ) ? sanitize_text_field( $_POST['option_name'] ) : '';
if ( empty( $license_key ) || empty( $item_name ) ) {
$response = new SBI_Response( false, array() );
$response->send();
}
// make the remote license check API call
$sbi_license_data = $this->get_license_data( $license_key, 'check_license', $item_name );
// update options data
$license_changed = $this->update_recheck_license_data( $sbi_license_data, $item_name, $option_name );
// send AJAX response back
$response = new SBI_Response( true, array(
'license' => $sbi_license_data['license'],
'licenseChanged' => $license_changed
) );
$response->send();
}
/**
* Update License Data
*
* @since 6.0
*
* @param array $license_data
* @param string $item_name
* @param string $option_name
*
* @return bool $license_changed
*/
public function update_recheck_license_data( $license_data, $item_name, $option_name ) {
$license_changed = false;
// if we are updating plugin's license data
if ( SBI_PLUGIN_NAME == $item_name ) {
// compare the old stored license status with new license status
if ( get_option( 'sbi_license_status' ) != $license_data['license'] ) {
$license_changed = true;
}
update_option( 'sbi_license_data', $license_data );
update_option( 'sbi_license_status', $license_data['license'] );
}
// If we are updating extensions license data
if ( SBI_PLUGIN_NAME != $item_name ) {
// compare the old stored license status with new license status
if ( get_option( 'sbi_license_status_' . $option_name ) != $license_data['license'] ) {
$license_changed = true;
}
update_option( 'sbi_license_status_' . $option_name, $license_data['license'] );
}
// if we are updating extensions license data and it's not valid
// then remote the extensions license status
if ( SBI_PLUGIN_NAME != $item_name && 'valid' != $license_data['license'] ) {
delete_option( 'sbi_license_status_' . $option_name );
}
return $license_changed;
}
/**
* SBI Import Feed Settings JSON
*
* @since 6.0
*
* @return SBI_Response
*/
public function sbi_import_settings_json() {
check_ajax_referer( 'sbi-admin', 'nonce' );
if ( ! sbi_current_user_can( 'manage_instagram_feed_options' ) ) {
wp_send_json_error();
}
$filename = $_FILES['file']['name'];
$ext = pathinfo($filename, PATHINFO_EXTENSION);
if ( 'json' !== $ext ) {
$response = new SBI_Response( false, [] );
$response->send();
}
$imported_settings = file_get_contents( $_FILES["file"]["tmp_name"] );
// check if the file is empty
if ( empty( $imported_settings ) ) {
$response = new SBI_Response( false, [] );
$response->send();
}
$feed_return = \InstagramFeed\Builder\SBI_Feed_Saver_Manager::import_feed( $imported_settings );
// check if there's error while importing
if ( ! $feed_return['success'] ) {
$response = new SBI_Response( false, [] );
$response->send();
}
// Once new feed has imported lets export all the feeds to update in front end
$exported_feeds = \InstagramFeed\Builder\SBI_Db::feeds_query();
$feeds = array();
foreach( $exported_feeds as $feed_id => $feed ) {
$feeds[] = array(
'id' => $feed['id'],
'name' => $feed['feed_name']
);
}
$response = new SBI_Response( true, array(
'feeds' => $feeds
) );
$response->send();
}
/**
* SBI Export Feed Settings JSON
*
* @since 6.0
*
* @return SBI_Response
*/
public function sbi_export_settings_json() {
if ( ! check_ajax_referer( 'sbi-admin', 'nonce', false ) ) {
wp_send_json_error();
}
if ( ! sbi_current_user_can( 'manage_instagram_feed_options' ) ) {
wp_send_json_error(); // This auto-dies.
}
if ( ! isset( $_GET['feed_id'] ) ) {
return;
}
$feed_id = filter_var( $_GET['feed_id'], FILTER_SANITIZE_NUMBER_INT );
$feed = \InstagramFeed\Builder\SBI_Feed_Saver_Manager::get_export_json( $feed_id );
$feed_info = \InstagramFeed\Builder\SBI_Db::feeds_query( array('id' => $feed_id) );
$feed_name = strtolower( $feed_info[0]['feed_name'] );
$filename = 'sbi-feed-' . $feed_name . '.json';
// create a new empty file in the php memory
$file = fopen( 'php://memory', 'w' );
fwrite( $file, $feed );
fseek( $file, 0 );
header( 'Content-type: application/json' );
header( 'Content-disposition: attachment; filename = "' . $filename . '";' );
fpassthru( $file );
exit;
}
/**
* SBI Clear Cache
*
* @since 6.0
*/
public function sbi_clear_cache() {
check_ajax_referer( 'sbi-admin', 'nonce' );
if ( ! sbi_current_user_can( 'manage_instagram_feed_options' ) ) {
wp_send_json_error();
}
// Get the updated cron schedule interval and time settings from user input and update the database
$model = isset( $_POST[ 'model' ] ) ? sanitize_text_field( $_POST['model'] ) : null;
if ( $model !== null ) {
$model = (array) \json_decode( \stripslashes( $model ) );
$feeds = (array) $model['feeds'];
}
// Now get the updated cron schedule interval and time values
$sbi_settings = get_option( 'sb_instagram_settings', array() );
$sbi_cache_cron_interval = $sbi_settings['sbi_cache_cron_interval'];
$sbi_cache_cron_time = $sbi_settings['sbi_cache_cron_time'];
$sbi_cache_cron_am_pm = $sbi_settings[ 'sbi_cache_cron_am_pm' ];
// Clear the stored caches in the database
$this->clear_stored_caches();
delete_option( 'sbi_cron_report' );
\SB_Instagram_Cron_Updater::start_cron_job( $sbi_cache_cron_interval, $sbi_cache_cron_time, $sbi_cache_cron_am_pm );
global $sb_instagram_posts_manager;
$sb_instagram_posts_manager->add_action_log( 'Saved settings on the configure tab.' );
$sb_instagram_posts_manager->clear_api_request_delays();
$response = new SBI_Response( true, array(
'cronNextCheck' => $this->get_cron_next_check()
) );
$response->send();
}
/**
* Clear the stored caches from the database and from other caching plugins
*
* @since 6.0
*/
public function clear_stored_caches() {
global $wpdb;
$cache_table_name = $wpdb->prefix . 'sbi_feed_caches';
$sql = "
UPDATE $cache_table_name
SET cache_value = ''
WHERE cache_key NOT IN ( 'posts_backup', 'header_backup' );";
$wpdb->query( $sql );
//Delete all SBI transients
$table_name = $wpdb->prefix . "options";
$wpdb->query( "
DELETE
FROM $table_name
WHERE `option_name` LIKE ('%\_transient\_sbi\_%')
" );
$wpdb->query( "
DELETE
FROM $table_name
WHERE `option_name` LIKE ('%\_transient\_timeout\_sbi\_%')
" );
$wpdb->query( "
DELETE
FROM $table_name
WHERE `option_name` LIKE ('%\_transient\_&sbi\_%')
" );
$wpdb->query( "
DELETE
FROM $table_name
WHERE `option_name` LIKE ('%\_transient\_timeout\_&sbi\_%')
" );
$wpdb->query( "
DELETE
FROM $table_name
WHERE `option_name` LIKE ('%\_transient\_\$sbi\_%')
" );
$wpdb->query( "
DELETE
FROM $table_name
WHERE `option_name` LIKE ('%\_transient\_timeout\_\$sbi\_%')
" );
\SB_Instagram_Cache::clear_legacy( true );
sb_instagram_clear_page_caches();
}
/**
* SBI Clear Image Resize Cache
*
* @since 6.0
*/
public function sbi_clear_image_resize_cache() {
check_ajax_referer( 'sbi-admin', 'nonce' );
if ( ! sbi_current_user_can( 'manage_instagram_feed_options' ) ) {
wp_send_json_error();
}
global $sb_instagram_posts_manager;
$sb_instagram_posts_manager->delete_all_sbi_instagram_posts();
delete_option( 'sbi_top_api_calls' );
$sb_instagram_posts_manager->add_action_log( 'Reset resizing tables.' );
$this->clear_stored_caches();
$response = new SBI_Response( true, [] );
$response->send();
}
/**
* SBI CLear Error Log
*
* @since 6.0
*/
public function sbi_clear_error_log() {
//Security Checks
check_ajax_referer( 'sbi-admin', 'nonce' );
if ( ! sbi_current_user_can( 'manage_instagram_feed_options' ) ) {
wp_send_json_error();
}
global $sb_instagram_posts_manager;
$sb_instagram_posts_manager->remove_all_errors();
global $sbi_notices;
$sbi_notices->remove_notice( 'critical_error' );
$user_id = get_current_user_id();
update_user_meta($user_id, 'sbi_ignore_new_user_sale_notice', 'always');
$sbi_notices->remove_notice( 'discount' );
$sbi_statuses_option = get_option('sbi_statuses', array());
update_option('sbi_rating_notice', 'dismissed', false);
$sbi_statuses_option['rating_notice_dismissed'] = sbi_get_current_time();
update_option('sbi_statuses', $sbi_statuses_option, false);
// remove the rating notice step 1 and step 2 from global notices
$sbi_notices->remove_notice('review_step_1');
$sbi_notices->remove_notice('review_step_2');
$sbi_notices->remove_notice('review_step_1_all_pages');
$sbi_notices->remove_notice('review_step_2_all_pages');
wp_send_json_success();
}
/**
* SBI CLear Error Log
*
* @since 6.0
*/
public function sbi_retry_db() {
//Security Checks
check_ajax_referer( 'sbi_nonce', 'sbi_nonce' );
if ( ! sbi_current_user_can( 'manage_instagram_feed_options' ) ) {
wp_send_json_error();
}
sbi_create_database_table( false );
\SB_Instagram_Feed_Locator::create_table();
\InstagramFeed\Builder\SBI_Db::create_tables( false );
global $wpdb;
$table_name = $wpdb->prefix . SBI_INSTAGRAM_POSTS_TYPE;
if ( $wpdb->get_var( "show tables like '$table_name'" ) !== $table_name ) {
wp_send_json_error( array( 'message' => '' . esc_html__( 'Unsuccessful. Try visiting our website.', 'instagram-feed' ) . '
' ) );
}
global $sbi_notices;
$sbi_notices->remove_notice( 'database_create' );
wp_send_json_success( array( 'message' => '' . esc_html__( 'Success! Try creating a feed and connecting a source.', 'instagram-feed' ) . '
' ) );
}
/**
* SBI Clear Image Resize Cache
*
* @since 6.0
*/
public function sbi_dpa_reset() {
check_ajax_referer( 'sbi-admin', 'nonce' );
if ( ! sbi_current_user_can( 'manage_instagram_feed_options' ) ) {
wp_send_json_error();
}
sbi_delete_all_platform_data();
$this->clear_stored_caches();
$response = new SBI_Response( true, [] );
$response->send();
}
/**
* SBI Get License Data from our license API
*
* @since 6.0
*
* @param string $license_key
* @param string $license_action
*
* @return void|array $sbi_license_data
*/
public function get_license_data( $license_key, $license_action = 'check_license', $item_name = SBI_PLUGIN_NAME ) {
$sbi_api_params = array(
'edd_action'=> $license_action,
'license' => $license_key,
'item_name' => urlencode( $item_name ) // the name of our product in EDD
);
$url = add_query_arg( $sbi_api_params, SBI_STORE_URL );
$args = array(
'timeout' => 60,
'sslverify' => false
);
// Make the remote API request
$request = \InstagramFeed\SBI_HTTP_Request::request( 'GET', $url, $args );
if ( \InstagramFeed\SBI_HTTP_Request::is_error( $request ) ) {
return;
}
$sbi_license_data = (array) \InstagramFeed\SBI_HTTP_Request::data( $request );
return $sbi_license_data;
}
/**
* Get license error message depending on license status
*
* @since 6.0
*
* @param array $sbi_license_data
*
* @return array $sbi_license_data
*/
public function get_license_error_message( $sbi_license_data ) {
global $sbi_download_id;
$license_key = null;
if ( get_option('sbi_license_key') ) {
$license_key = sanitize_key( get_option('sbi_license_key') );
}
$upgrade_url = sprintf('https://smashballoon.com/instagram-feed/pricing/?license_key=%s&upgrade=true&utm_campaign=instagram-free&utm_source=settings&utm_medium=upgrade-license', $license_key);
$renew_url = sprintf('https://smashballoon.com/checkout/?license_key=%s&download_id=%s&utm_campaign=instagram-free&utm_source=settings&utm_medium=upgrade-license&utm_content=renew-license', $license_key, sanitize_key( $sbi_download_id ) );
$learn_more_url = 'https://smashballoon.com/doc/my-license-key-wont-activate/?utm_campaign=instagram-free&utm_source=settings&utm_medium=license&utm_content=learn-more';
// Check if the license key reached max site installations
if ( isset( $sbi_license_data['error'] ) && 'no_activations_left' === $sbi_license_data['error'] ) {
$sbi_license_data['errorMsg'] = sprintf( __( 'You have reached the maximum number of sites available in your plan %s', 'instagram-feed' ), '(' . (int)$sbi_license_data['site_count'] . '/' . (int)$sbi_license_data['max_sites'] . ')' );
$sbi_license_data['errorMsg'] .= ' ' . sprintf( __( '%sLearn more about%s it or %supgrade your plan%s', 'instagram-feed' ), '', ' ', '', ' ' );
}
// Check if the license key has expired
if (
( isset( $sbi_license_data['license'] ) && 'expired' === $sbi_license_data['license'] ) ||
( isset( $sbi_license_data['error'] ) && 'expired' === $sbi_license_data['error'] )
) {
$sbi_license_data['error'] = true;
$expired_date = new \DateTime( $sbi_license_data['expires'] );
$expired_date = $expired_date->format('F d, Y');
$sbi_license_data['errorMsg'] = sprintf(
'%s %s. %s %s ',
__( 'The license expired on ', 'instagram-feed' ),
$expired_date,
__( 'Please renew it and try again.', 'instagram-feed' ),
$renew_url,
__( 'Renew', 'instagram-feed' )
);
}
return $sbi_license_data;
}
/**
* Remove admin footer message
*
* @since 6.0
*
* @return string
*/
public function remove_admin_footer_text() {
return '';
}
/**
* Register Menu.
*
* @since 6.0
*/
public function register_menu() {
// remove admin page update footer
add_filter( 'update_footer', [$this, 'remove_admin_footer_text'] );
$cap = current_user_can( 'manage_custom_instagram_feed_options' ) ? 'manage_custom_instagram_feed_options' : 'manage_options';
$cap = apply_filters( 'sbi_settings_pages_capability', $cap );
global $sb_instagram_posts_manager;
$notice = '';
if ( $sb_instagram_posts_manager->are_critical_errors() ) {
$notice = ' ! ';
}
$global_settings = add_submenu_page(
'sb-instagram-feed',
__( 'Settings', 'instagram-feed' ),
__( 'Settings ' . $notice , 'instagram-feed' ),
$cap,
'sbi-settings',
[$this, 'global_settings'],
1
);
add_action( 'load-' . $global_settings, [$this,'builder_enqueue_admin_scripts']);
}
/**
* Enqueue Builder CSS & Script.
*
* Loads only for builder pages
*
* @since 6.0
*/
public function builder_enqueue_admin_scripts(){
if( ! get_current_screen() ) {
return;
}
$screen = get_current_screen();
if ( ! 'instagram-feed_page_sbi-settings' === $screen->id ) {
return;
}
$sbi_status = 'inactive';
global $wp_version;
$can_install_automator_plugin = ( version_compare($wp_version,'5.3') >= 0 ) ? true : false;
$model = $this->get_settings_data();
$exported_feeds = \InstagramFeed\Builder\SBI_Db::feeds_query();
$feeds = array();
foreach( $exported_feeds as $feed_id => $feed ) {
$feeds[] = array(
'id' => $feed['id'],
'name' => $feed['feed_name']
);
}
$licenseErrorMsg = null;
$license_key = sanitize_key( trim( get_option( 'sbi_license_key', '' ) ) );
if ( $license_key ) {
$license_last_check = get_option( 'sbi_license_last_check_timestamp' );
$date = time() - (DAY_IN_SECONDS * 90);
if ( $date > $license_last_check ) {
// make the remote api call and get license data
$sbi_license_data = $this->get_license_data( $license_key );
if( !empty($sbi_license_data) ) update_option( 'sbi_license_data', $sbi_license_data );
update_option( 'sbi_license_last_check_timestamp', time() );
} else {
$sbi_license_data = get_option( 'sbi_license_data' );
}
// update the license data with proper error messages when necessary
$sbi_license_data = $this->get_license_error_message( $sbi_license_data );
$sbi_status = ! empty( $sbi_license_data['license'] ) ? $sbi_license_data['license'] : false;
$licenseErrorMsg = ( isset( $sbi_license_data['error'] ) && isset( $sbi_license_data['errorMsg'] ) ) ? $sbi_license_data['errorMsg'] : null;
}
$current_user_id = get_current_user_id();
$get_sb_active_plugins_info = Util::get_sb_active_plugins_info();
$should_hide_automtor_notice = ( get_user_meta( $current_user_id, 'sbi_dismiss_automator_notice' ) ) ? true : false;
wp_enqueue_style(
'settings-style',
SBI_PLUGIN_URL . 'admin/assets/css/settings.css',
false,
SBIVER
);
\InstagramFeed\Builder\SBI_Feed_Builder::global_enqueue_ressources_scripts(true);
wp_enqueue_script(
'settings-app',
SBI_PLUGIN_URL.'admin/assets/js/settings.js',
null,
SBIVER,
true
);
$license_key = null;
if ( get_option('sbi_license_key') ) {
$license_key = sanitize_key( get_option('sbi_license_key') );
}
$has_license_error = false;
if (
( isset( $sbi_license_data['license'] ) && 'expired' === $sbi_license_data['license'] ) ||
( isset( $sbi_license_data['error'] ) && ( $sbi_license_data['error'] || 'expired' == $sbi_license_data['error'] ) )
) {
$has_license_error = true;
}
$upgrade_url = sprintf('https://smashballoon.com/instagram-feed/pricing/?license_key=%s&upgrade=true&utm_campaign=instagram-free&utm_source=settings&utm_medium=upgrade-license', $license_key);
$footer_upgrade_url = 'https://smashballoon.com/instagram-feed/demo?utm_campaign=instagram-free&utm_source=settings&utm_medium=footer-banner&utm_content=Try Demo';
$usage_tracking_url = 'https://smashballoon.com/instagram-feed/usage-tracking/';
$feed_issue_email_url = 'https://smashballoon.com/doc/email-report-is-not-in-my-inbox/?instagram';
$sources_list = \InstagramFeed\Builder\SBI_Feed_Builder::get_source_list();
// Extract only license keys and build array for extensions license keys
$sbi_settings = array(
'admin_url' => admin_url(),
'ajax_handler' => admin_url( 'admin-ajax.php' ),
'nonce' => wp_create_nonce( 'sbi-admin' ),
'supportPageUrl' => admin_url( 'admin.php?page=sbi-support' ),
'builderUrl' => admin_url( 'admin.php?page=sbi-feed-builder' ),
'links' => $this->get_links_with_utm(),
'uoActive' => is_plugin_active( 'uncanny-automator/uncanny-automator.php' ),
'pluginItemName' => SBI_PLUGIN_NAME,
'licenseType' => 'free',
'licenseKey' => $license_key,
'licenseStatus' => $sbi_status,
'licenseErrorMsg' => $licenseErrorMsg,
'extensionsLicense' => array(),
'extensionsLicenseKey' => array(),
'hasError' => $has_license_error,
'upgradeUrl' => $upgrade_url,
'footerUpgradeUrl' => $footer_upgrade_url,
'isDevSite' => SBI_Upgrader::is_dev_url( home_url() ),
'model' => $model,
'feeds' => $feeds,
'sources' => $sources_list,
//'locales' => SBI_Settings::locales(),
//'timezones' => SBI_Settings::timezones(),
//'socialWallLinks' => \InstagramFeed\Builder\SBI_Feed_Builder::get_social_wall_links(),
'socialWallLinks' => \InstagramFeed\Builder\SBI_Feed_Builder::get_social_wall_links(),
'socialWallActivated' => is_plugin_active( 'social-wall/social-wall.php' ),
'genericText' => \InstagramFeed\Builder\SBI_Feed_Builder::get_generic_text(),
'legacyCSSSettings' => Util::sbi_show_legacy_css_settings(),
'generalTab' => array(
'uoInstallNotice' => array(
'notice' => __( 'Post to Instagram right from WordPress with Uncanny Automator', 'instagram-feed' ),
'learnMore' => __( 'Learn More', 'instagram feed' ),
'logo' => ' ',
'closeIcon' => ' '
),
'licenseBox' => array(
'title' => __( 'License Key', 'instagram-feed' ),
'description' => __( 'Your license key provides access to updates and support', 'instagram-feed' ),
'activeText' => __( 'Your Instagram Feed Pro license is Active!', 'instagram-feed' ),
'inactiveText' => __( 'Your Instagram Feed Pro license is Inactive!', 'instagram-feed' ),
'freeText' => __( 'Already purchased? Simply enter your license key below to activate Instagram Feed Pro.', 'instagram-feed'),
'inactiveFieldPlaceholder' => __( 'Paste license key here', 'instagram-feed' ),
'upgradeText1' => sprintf( __( 'You are using the Lite version of the plugin–no license needed. Enjoy! 🙂 To unlock more features, consider %s.', 'instagram-feed' ), '' . __( 'upgrading to Pro.', 'instagram-feed' ) . ' ' ),
'upgradeText2' => __( 'As a valued user of our Lite plugin, you receive 50% OFF - automatically applied at checkout!', 'instagram-feed' ),
'manageLicense' => __( 'Manage License', 'instagram-feed' ),
'test' => __( 'Test Connection', 'instagram-feed' ),
'recheckLicense' => __( 'Recheck license', 'instagram-feed' ),
'licenseValid' => __( 'License valid', 'instagram-feed' ),
'licenseExpired' => __( 'License expired', 'instagram-feed' ),
'connectionSuccessful' => __( 'Connection successful', 'instagram-feed' ),
'connectionFailed' => __( 'Connection failed', 'instagram-feed' ),
'viewError' => __( 'View error', 'instagram-feed' ),
'upgrade' => __( 'Upgrade', 'instagram-feed' ),
'deactivate' => __( 'Deactivate', 'instagram-feed' ),
'activate' => __( 'Activate', 'instagram-feed' ),
),
'manageSource' => array(
'title' => __( 'Manage Sources', 'instagram-feed' ),
'description' => __( 'Add or remove connected Instagram accounts', 'instagram-feed' ),
),
'preserveBox' => array(
'title' => __( 'Preserve settings if plugin is removed', 'instagram-feed' ),
'description' => __( 'This will make sure that all of your feeds and settings are still saved even if the plugin is uninstalled', 'instagram-feed' ),
),
'importBox' => array(
'title' => __( 'Import Feed Settings', 'instagram-feed' ),
'description' => __( 'You will need a JSON file previously exported from the Instagram Feed Plugin', 'instagram-feed' ),
'button' => __( 'Import', 'instagram-feed' ),
),
'exportBox' => array(
'title' => __( 'Export Feed Settings', 'instagram-feed' ),
'description' => __( 'Export settings for one or more of your feeds', 'instagram-feed' ),
'button' => __( 'Export', 'instagram-feed' ),
)
),
'feedsTab' => array(
'localizationBox' => array(
'title' => __( 'Localization', 'instagram-feed' ),
'tooltip' => 'This controls the language of any predefined text strings provided by Instagram. For example, the descriptive text that accompanies some timeline posts (eg: Smash Balloon created an event) and the text in the \'Like Box\' widget. To find out how to translate the other text in the plugin see this FAQ .
'
),
'timezoneBox' => array(
'title' => __( 'Timezone', 'instagram-feed' )
),
'cachingBox' => array(
'title' => __( 'Caching', 'instagram-feed' ),
'pageLoads' => __( 'When the Page loads', 'instagram-feed' ),
'inTheBackground' => __( 'In the Background', 'instagram-feed' ),
'inTheBackgroundOptions' => array(
'30mins' => __( 'Every 30 minutes', 'instagram-feed' ),
'1hour' => __( 'Every hour', 'instagram-feed' ),
'12hours' => __( 'Every 12 hours', 'instagram-feed' ),
'24hours' => __( 'Every 24 hours', 'instagram-feed' ),
),
'am' => __( 'AM', 'instagram-feed' ),
'pm' => __( 'PM', 'instagram-feed' ),
'clearCache' => __( 'Clear All Caches', 'instagram-feed' )
),
'gdprBox' => array(
'title' => __( 'GDPR', 'instagram-feed' ),
'automatic' => __( 'Automatic', 'instagram-feed' ),
'yes' => __( 'Yes', 'instagram-feed' ),
'no' => __( 'No', 'instagram-feed' ),
'infoAuto' => $this->get_gdpr_auto_info(),
'infoYes' => __( 'No requests will be made to third-party websites. To accommodate this, some features of the plugin will be limited.', 'instagram-feed' ),
'infoNo' => __( 'The plugin will function as normal and load images and videos directly from Instagram', 'instagram-feed' ),
'someInstagram' => __( 'Some Instagram Feed features will be limited for visitors to ensure GDPR compliance, until they give consent.', 'instagram-feed'),
'whatLimited' => __( 'What will be limited?', 'instagram-feed'),
'tooltip' => 'If set to “Yes”, it prevents all images and videos from being loaded directly from Instagram’s servers (CDN) to prevent any requests to external websites in your browser. To accommodate this, some features of your plugin will be disabled or limited.
If set to “No”, the plugin will still make some requests to load and display images and videos directly from Instagram.
If set to “Automatic”, it will only load images and videos directly from Instagram if consent has been given by one of these integrated GDPR cookie Plugins.
Learn More
',
'gdprTooltipFeatureInfo' => array(
'headline' => __( 'Features that would be disabled or limited include: ', 'instagram-feed'),
'features' => array(
__( 'Only local images (not from Instagram\'s CDN) will be displayed in the feed.', 'instagram-feed'),
__( 'Placeholder blank images will be displayed until images are available.', 'instagram-feed'),
__( 'Video posts will link to the post on Instagram.com for visitors to watch.', 'instagram-feed'),
__( 'Carousel posts will only show the first image in the lightbox.', 'instagram-feed'),
__( 'The maximum image resolution will be 640 pixels wide in the lightbox.', 'instagram-feed'),
)
)
),
'customCSSBox' => array(
'title' => __( 'Custom CSS', 'instagram-feed' ),
'placeholder' => __( 'Enter any custom CSS here', 'instagram-feed' ),
),
'customJSBox' => array(
'title' => __( 'Custom JS', 'instagram-feed' ),
'placeholder' => __( 'Enter any custom JS here', 'instagram-feed' ),
)
),
'advancedTab' => array(
'legacyCSSBox' => array(
'title' => __( 'Use legacy CSS', 'instagram-feed' ),
'helpText' => __( 'This would revert your CSS file for the feed to the file used in version 6.2. Enable this setting if your customizations are not working properly. ', 'instagram-feed' ) . '' . __('Learn More', 'instagram-feed') .' ',
),
'optimizeBox' => array(
'header' => __('Image Optimization (Recommended)', 'instagram-feed'),
'helpText' => __('Creates multiple local copies of image in different sizes and uses smallest size based on where it is displayed. ', 'instagram-feed') . '' . __('Uses local Wordpress storage.', 'instagram-feed') . ' ',
'reset' => __('Reset Image Storage', 'instagram-feed'),
'title' => __('Use dynamic sizes', 'instagram-feed'),
'formatTitle' => __('Default Image Format', 'instagram-feed'),
'formats' => array(
'webp' => __('WebP', 'instagram-feed'),
'jpg' => __('JPG', 'instagram-feed'),
),
),
'usageBox' => array(
'title' => __( 'Usage Tracking', 'instagram-feed' ),
'helpText' => sprintf( __( 'This helps to prevent plugin and theme conflicts by sending a report in the background once per week about your settings and relevant site stats. It does not send sensitive information like access tokens, email addresses, or user info. This will also not affect your site performance. %s', 'instagram-feed' ), '' . __( 'Learn More', 'instagram-feed' ) . ' ' ),
),
'resetErrorBox' => array(
'title' => __( 'Reset Error Log', 'instagram-feed' ),
'helpText' => __( 'Clear all errors stored in the error log.', 'instagram-feed' ),
'reset' => __( 'Reset', 'instagram-feed' ),
),
'ajaxBox' => array(
'title' => __( 'AJAX theme loading fix', 'instagram-feed' ),
'helpText' => __( 'Fixes issues caused by Ajax loading themes. It can also be used to workaround JavaScript errors on the page.', 'instagram-feed' ),
),
'ajaxInitial' => array(
'title' => __( 'Load Initial Posts with AJAX', 'instagram-feed' ),
'helpText' => __( 'Initial posts will be loaded using AJAX instead of added to the page directly. If you use page caching, this will allow the feed to update according to the "Check for new posts every" setting on the "Configure" tab.', 'instagram-feed' ),
),
'enqueueHead' => array(
'title' => __( 'Enqueue JavaScript in head', 'instagram-feed' ),
'helpText' => __( 'Add the JavaScript file for the plugin in the HTML "head" instead of the footer.', 'instagram-feed' ),
),
'enqueueShortcode' => array(
'title' => __( 'Enqueue CSS only on pages with the Feed', 'instagram-feed' ),
'helpText' => '',
),
'jsImages' => array(
'title' => __( 'JavaScript Image Loading', 'instagram-feed' ),
'helpText' => __( 'Load images on the client side with JS, instead of server side.', 'instagram-feed' ),
),
'loadAjax' => array(
'title' => __( 'Fix a text shortening issue caused by some themes', 'instagram-feed' ),
'helpText' => __( 'Initial posts will be loaded using AJAX instead of added to the page directly. If you use page caching, this will allow the feed to update according to the "Check for new posts every" setting on the "Configure" tab.', 'instagram-feed' ),
),
'adminErrorBox' => array(
'title' => __( 'Admin Error Notice', 'instagram-feed' ),
'helpText' => __( 'This will disable or enable the feed error notice that displays in the bottom right corner of your site for logged-in admins.', 'instagram-feed' ),
),
'feedIssueBox' => array(
'title' => __( 'Feed Issue Email Reports', 'instagram-feed' ),
'helpText' => __( 'If the feed is down due to a critical issue, we will switch to a cached version and notify you based on these settings. View Documentation ', 'instagram-feed' ),
'sendReport' => __( 'Send a report every', 'instagram-feed' ),
'to' => __( 'to', 'instagram-feed' ),
'placeholder' => __( 'Enter one or more email address separated by comma', 'instagram-feed' ),
'weekDays' => array(
array(
'val' => 'monday',
'label' => __( 'Monday', 'instagram-feed' )
),
array(
'val' => 'tuesday',
'label' => __( 'Tuesday', 'instagram-feed' )
),
array(
'val' => 'wednesday',
'label' => __( 'Wednesday', 'instagram-feed' )
),
array(
'val' => 'thursday',
'label' => __( 'Thursday', 'instagram-feed' )
),
array(
'val' => 'friday',
'label' => __( 'Friday', 'instagram-feed' )
),
array(
'val' => 'saturday',
'label' => __( 'Saturday', 'instagram-feed' )
),
array(
'val' => 'sunday',
'label' => __( 'Sunday', 'instagram-feed' )
),
)
),
'dpaClear' => array(
'title' => __( 'Manage Data', 'instagram-feed' ),
'helpText' => __( 'Warning: Clicking this button will permanently delete all Instagram data, including all connected accounts, cached posts, and stored images.', 'instagram-feed' ),
'clear' => __( 'Delete all Platform Data', 'instagram-feed' ),
),
),
'dialogBoxPopupScreen' => array(
'deleteSource' => array(
'heading' => __( 'Delete "#"?', 'instagram-feed' ),
'description' => __( 'This source is being used in a feed on your site. If you delete this source then new posts can no longer be retrieved for these feeds.', 'instagram-feed' ),
),
),
'selectSourceScreen' => \InstagramFeed\Builder\SBI_Feed_Builder::select_source_screen_text(),
'uncannyAutomatorScreen' => array(
'heading' => __( 'Automatically post from WordPress to Instagram with the #1 automation plugin', 'instagram-feed' ),
'description' => __( 'Uncanny Automator lets you easily automate your WordPress site. Automatically push new blog posts to your Instagram Business account (and Facebook and Twitter too).', 'instagram-feed' ),
'integrationLogo' => SBI_PLUGIN_URL . '/admin/assets/img/instagram-with-uncanny-automator.png',
'installStep' => array(
'title' => __( 'Install and activate Uncanny Automator', 'instagram-feed' ),
'description' => __( 'The plugin is installed from the Wordpress.org repository', 'instagram-feed' ),
'icon' => SBI_PLUGIN_URL . '/admin/assets/img/uncanny-automator-logo.png',
),
'setupStep' => array(
'title' => __( 'Set up Uncanny Automator', 'instagram-feed' ),
'description' => __( 'Connect Uncanny Automator to your Instagram account', 'instagram-feed' ),
'icon' => SBI_PLUGIN_URL . '/admin/assets/img/setup-uncanny-automator.png',
),
'shouldHideAutomatorNotice' => $should_hide_automtor_notice,
'canInstallAutomatorPlugin' => $can_install_automator_plugin,
'isPluginInstalled' => $get_sb_active_plugins_info['is_uncanny_automator_installed'],
'isPluginActive' => is_plugin_active($get_sb_active_plugins_info['uncanny_automator_plugin']),
'pluginDownloadPath' => $get_sb_active_plugins_info['uncanny_automator_download_plugin'],
'automatorPlugin' => $get_sb_active_plugins_info['uncanny_automator_plugin'],
'installSVG' => ' ',
'enableSetupStep' => is_plugin_active($get_sb_active_plugins_info['uncanny_automator_plugin']),
'setupPage' => '/edit.php?post_type=uo-recipe&page=uncanny-automator-config&tab=premium-integrations&integration=instagram'
),
'nextCheck' => $this->get_cron_next_check(),
'loaderSVG' => ' ',
'checkmarkSVG' => ' ',
'timesCircleSVG' => ' ',
'uploadSVG' => '
',
'checkmarCircleSVG' => ' ',
'exportSVG' => '
',
'reloadSVG' => '
',
'tooltipHelpSvg' => ' ',
'svgIcons' => \InstagramFeed\Builder\SBI_Feed_Builder::builder_svg_icons(),
'resetSVG' => ' '
);
$newly_retrieved_source_connection_data = \InstagramFeed\Builder\SBI_Source::maybe_source_connection_data();
if ( $newly_retrieved_source_connection_data ) {
$sbi_settings['newSourceData'] = $newly_retrieved_source_connection_data;
}
if ( isset( $_GET['manualsource'] ) && $_GET['manualsource'] == true ) {
$sbi_settings['manualSourcePopupInit'] = true;
}
wp_localize_script(
'settings-app',
'sbi_settings',
$sbi_settings
);
}
/**
* Get Extensions License Information
*
* @since 6.0
*
* @return array
*/
public function get_extensions_license() {
return;
}
/**
* Get Links with UTM
*
* @return array
*
* @since 6.0
*/
public static function get_links_with_utm() {
$license_key = null;
if ( get_option('sbi_license_key') ) {
$license_key = sanitize_key( get_option('sbi_license_key') );
}
$all_access_bundle_popup = sprintf('https://smashballoon.com/all-access/?license_key=%s&upgrade=true&utm_campaign=instagram-free&utm_source=balloon&utm_medium=all-access', $license_key);
return array(
'manageLicense' => 'https://smashballoon.com/account/downloads/?utm_campaign=instagram-free&utm_source=settings&utm_medium=manage-license',
'popup' => array(
'allAccessBundle' => $all_access_bundle_popup,
'fbProfile' => 'https://www.instagram.com/SmashBalloon/',
'twitterProfile' => 'https://twitter.com/smashballoon',
),
);
}
/**
* The Settings Data
*
* @since 6.0
*
* @return array
*/
public function get_settings_data() {
$sbi_settings = wp_parse_args( get_option( 'sb_instagram_settings' ), $this->default_settings_options() );
$sbi_cache_cron_interval = $sbi_settings['sbi_cache_cron_interval'] ;
$sbi_cache_cron_time = $sbi_settings['sbi_cache_cron_time'];
$sbi_cache_cron_am_pm = $sbi_settings['sbi_cache_cron_am_pm'];
$usage_tracking = get_option( 'sbi_usage_tracking', array( 'last_send' => 0, 'enabled' => \sbi_is_pro_version() ) );
$sbi_ajax = $sbi_settings['sb_instagram_ajax_theme'];
$active_gdpr_plugin = \SB_Instagram_GDPR_Integrations::gdpr_plugins_active();
$sbi_preserve_setitngs = $sbi_settings['sb_instagram_preserve_settings'];
$custom_css = '';
$custom_js = '';
if ( current_user_can( 'unfiltered_html' ) ) {
$custom_css = isset( $sbi_settings['sb_instagram_custom_css'] ) ? wp_strip_all_tags( stripslashes( $sbi_settings['sb_instagram_custom_css'] ) ) : '';
$custom_js = isset( $sbi_settings['sb_instagram_custom_js'] ) ? stripslashes( $sbi_settings['sb_instagram_custom_js'] ) : '';
}
return array(
'general' => array(
'preserveSettings' => $sbi_preserve_setitngs
),
'feeds' => array(
'cachingType' => 'background',
'cronInterval' => $sbi_cache_cron_interval,
'cronTime' => $sbi_cache_cron_time,
'cronAmPm' => $sbi_cache_cron_am_pm,
'gdpr' => $sbi_settings['gdpr'],
'gdprPlugin' => $active_gdpr_plugin,
'customCSS' => $custom_css,
'customJS' => $custom_js,
),
'advanced' => array(
'sbi_enable_resize' => !$sbi_settings['sb_instagram_disable_resize'],
'image_format' => $sbi_settings['image_format'],
'usage_tracking' => $usage_tracking['enabled'],
'sbi_ajax' => $sbi_ajax,
'sb_ajax_initial' => $sbi_settings['sb_ajax_initial'],
'sbi_enqueue_js_in_head' => $sbi_settings['enqueue_js_in_head'],
'sbi_enqueue_css_in_shortcode' => $sbi_settings['enqueue_css_in_shortcode'],
'sbi_enable_js_image_loading' => !$sbi_settings['disable_js_image_loading'],
'enqueue_legacy_css' => $sbi_settings['enqueue_legacy_css'],
'enable_admin_notice' => !$sbi_settings['disable_admin_notice'],
'enable_email_report' => $sbi_settings['enable_email_report'],
'email_notification' => $sbi_settings['email_notification'],
'email_notification_addresses' => $sbi_settings['email_notification_addresses'],
)
);
}
/**
* Return the default settings options for sbi_style_settings option
*
* @since 6.0
*
* @return array
*/
public function default_settings_options() {
return sbi_defaults();
}
/**
* Get GDPR Automatic state information
*
* @since 6.0
*
* @return string $output
*/
public function get_gdpr_auto_info() {
$gdpr_doc_url = 'https://smashballoon.com/doc/instagram-feed-gdpr-compliance/?instagram';
$output = '';
$active_gdpr_plugin = \SB_Instagram_GDPR_Integrations::gdpr_plugins_active();
if ( $active_gdpr_plugin ) {
$output = $active_gdpr_plugin;
} else {
$output = sprintf( __( 'No GDPR consent plugin detected. Install a compatible GDPR consent %s, or manually enable the setting to display a GDPR compliant version of the feed to all visitors.', 'instagram-feed' ), '' . __( 'plugin', 'instagram-feed' ). ' ' );
}
return $output;
}
/**
* SBI Get cron next check time
*
* @since 6.0
*
* @return string $output
*/
public function get_cron_next_check() {
$output = '';
if ( wp_next_scheduled( 'sbi_feed_update' ) ) {
$time_format = get_option( 'time_format' );
if ( ! $time_format ) {
$time_format = 'g:i a';
}
//
$schedule = wp_get_schedule( 'sbi_feed_update' );
if ( $schedule == '30mins' ) $schedule = __( 'every 30 minutes', 'instagram-feed' );
if ( $schedule == 'twicedaily' ) $schedule = __( 'every 12 hours', 'instagram-feed' );
$sbi_next_cron_event = wp_next_scheduled( 'sbi_feed_update' );
$output = '' . __( 'Next check', 'instagram-feed' ) . ': ' . date( $time_format, $sbi_next_cron_event + sbi_get_utc_offset() ) . ' (' . $schedule . ') - ' . __( 'Note: Clicking "Clear All Caches" will reset this schedule.', 'instagram-feed' );
} else {
$output = __( 'Nothing currently scheduled', 'instagram-feed' );
}
return $output;
}
/**
* Settings Page View Template
*
* @since 6.0
*/
public function global_settings(){
\InstagramFeed\SBI_View::render( 'settings.index' );
}
}
PK L\0+k% % : instagram-feed/admin/assets/img/uncanny-automator-logo.pngnu [ PNG
IHDR > hkZ PLTE KGTNOYjj}&*J&(D (=.3K'@DNbMQ`"D";"@48U5*4@#>="?07J2;[MOW!=#,F&@'.G2=T9!=?H\".I*(F&C(:Z|dq*))(~)c+y&x4('*-9V$2qlXm+6P)2JrEʐ]%.Dъze#,; '7>/wiՄа͜a:X`4`&˜ɑڼ~oŤĠF8觾ƌan~7CXTDO}uzkKVgle=K^FO]aQL