clear_fwembed_cache(); echo '

' . __('Cache cleared successfully!', 'fourthwall_text_domain') . '

'; } // Admin Page Layout echo '
' . "\n"; echo '

' . get_admin_page_title() . '

' . "\n"; echo '
' . "\n"; settings_fields( 'fourthwall_settings_group' ); do_settings_sections( 'fourthwall_settings_name' ); submit_button(); echo '
' . "\n"; // Cache clearing form echo '
' . "\n"; echo ' ' . wp_nonce_field('clear_fwembed_cache', '_wpnonce', true, false) . "\n"; echo ' ' . "\n"; echo '

' . __('Clear the cached Fourthwall content. Use this if products are not updating.', 'fourthwall_text_domain') . '

' . "\n"; echo '
' . "\n"; echo '
' . "\n"; echo '

' . __( 'Shortcode Usage', 'fourthwall_text_domain' ) . '

' . "\n"; echo '

' . __( 'Display entire store:', 'fourthwall_text_domain' ) . ' [fourthwall]

' . "\n"; echo '

' . __( 'Display single product:', 'fourthwall_text_domain' ) . ' [fourthwall_single url="https://your-store.fourthwall.com/products/product-name"]

' . "\n"; echo '

' . __( 'With description:', 'fourthwall_text_domain' ) . ' [fourthwall_single url="https://your-store.fourthwall.com/products/product-name" show_description="true"]

' . "\n"; echo '

' . __( 'Display random products:', 'fourthwall_text_domain' ) . ' [fourthwall_random count="5"]

' . "\n"; echo '

' . __( 'Random from specific URLs:', 'fourthwall_text_domain' ) . ' [fourthwall_random count="3" urls="https://store.com/product1,https://store.com/product2,https://store.com/product3"]

' . "\n"; echo '

' . __( 'Random from different store:', 'fourthwall_text_domain' ) . ' [fourthwall_random count="2" store_url="https://different-store.fourthwall.com"]

' . "\n"; echo '

' . __( 'Note: Disable SSL verification only for local development. Keep enabled for production sites.', 'fourthwall_text_domain' ) . '

' . "\n"; echo '
' . "\n"; echo '
' . "\n"; } function render_fourth_url_field() { // Retrieve data from the database. $options = get_option( 'fourthwall_settings_name' ); // Set default value. $value = isset( $options['fourth_url'] ) ? $options['fourth_url'] : ''; // Field output. echo ''; echo '

' . __( 'The fourth wall URL', 'fourthwall_text_domain' ) . '

'; } function render_ssl_verify_field() { // Retrieve data from the database. $options = get_option( 'fourthwall_settings_name' ); // Set default value. $value = isset( $options['ssl_verify'] ) ? $options['ssl_verify'] : ''; // Field output. echo ''; echo '

' . __( 'Enable SSL verification', 'fourthwall_text_domain' ) . '

'; } /** * Clear all Fourthwall embed cache */ private function clear_fwembed_cache() { global $wpdb; // Delete all transients that start with 'fwembed_' $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s", '_transient_fwembed_%' ) ); // Also delete transient timeouts $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s", '_transient_timeout_fwembed_%' ) ); } } new fourthwall_settings;