Webidextrous Knowledge Base

Explore our knowledge base for information about our products and services, or to get help troubleshooting your issue.

Articles coming soon

Frequently Asked Questions

Development & Customization

Answer: Follow WordPress best practices:

// Add to functions.php or your custom plugin
function theme_enqueue_scripts() {
    // Enqueue CSS
    wp_enqueue_style(
        'main-style',
        get_template_directory_uri() . '/assets/css/main.css',
        array(), // dependencies
        '1.0.0' // version
    );
    
    // Enqueue JavaScript
    wp_enqueue_script(
        'main-script',
        get_template_directory_uri() . '/assets/js/main.js',
        array('jquery'), // dependencies
        '1.0.0', // version
        true // load in footer
    );
    
    // Localize script with data
    wp_localize_script(
        'main-script',
        'siteData',
        array(
            'ajaxUrl' => admin_url('admin-ajax.php'),
            'siteUrl' => site_url()
        )
    );
}
add_action('wp_enqueue_scripts', 'theme_enqueue_scripts');

Key points:

  • Always use wp_enqueue hooks, never hardcode script tags

  • Load scripts in footer when possible

  • Use dependencies array to manage load order

  • Include version strings for cache busting

  • Use wp_localize_script for passing PHP data to JavaScript

Answer: Use one of these methods:

  • Child Theme (Recommended for most cases):
// In child-theme style.css
/*
Theme Name: Parent Theme Child
Template: parent-theme-folder-name
Description: Child theme for customizations
Version: 1.0
*/

/* Import parent theme styles */
@import url("../parent-theme-folder-name/style.css");

/* Custom styles below */

Create a site-specific plugin for functionality changes:

<?php
/**
 * Plugin Name: Site-Specific Functionality
 * Description: Custom functions for this specific site
 * Version: 1.0
 */

// Custom functions go here
function my_custom_function() {
    // Function code
}

// Add shortcodes
add_shortcode('my_shortcode', 'my_shortcode_function');
  • Use hooks and filters instead of modifying core files
  • Document all customizations in a central location for reference

 

E-commerce & Forms

Answer: Choose the appropriate method based on your needs:

// Register fields with ACF
// Then display in template:
<?php 
$custom_field = get_field('specification_sheet', $product_id);
if($custom_field) {
    echo '<a href="' . $custom_field . '">Download Specification Sheet</a>';
}
?>
  • WooCommerce native Custom Fields:
    • Use Product Data → Custom Fields tab in admin

    • Access with get_post_meta($product_id, 'field_name', true);

  • Custom Product Attributes:
    • For filterable/searchable data

    • Can be global or per-product

    • Access with $product->get_attribute('attribute_name');

  • Custom Product Data Tabs:
add_filter('woocommerce_product_tabs', 'add_custom_product_tab');
function add_custom_product_tab($tabs) {
    $tabs['specifications_tab'] = array(
        'title' => 'Specifications',
        'priority' => 20,
        'callback' => 'specifications_tab_content'
    );
    return $tabs;
}

function specifications_tab_content() {
    global $product;
    // Tab content here
}

Answer: Follow this systematic approach:

  • Check server requirements:
    • PHP version compatibility

    • Required PHP extensions (curl, json, etc.)

    • SSL certificate validity

  • Common issues and solutions:
    • Payment failing silently: Enable WooCommerce logging (WooCommerce → Settings → Advanced → Logging) and check logs

    • API connectivity: Test with Postman or similar tool to verify endpoint access

    • SSL issues: Verify mixed content warnings with browser console

    • Webhook failures: Check webhook delivery in payment gateway dashboard

  • Gateway-specific troubleshooting:
// Example debug code for Stripe
add_action('woocommerce_before_checkout_form', function() {
    WC_Stripe_Logger::log('Checkout initiated: ' . $_SERVER['REMOTE_ADDR']);
});
  • Testing process:
    • Use gateway sandbox/test modes

    • Try test card numbers (Stripe: 4242 4242 4242 4242)

    • Verify IPN/webhook settings

    • Check currency support

Security & Maintenance

Answer: Follow these steps to set up an effective staging environment:

  • Server Setup Options:
    • Subdomain (staging.yourdomain.com)

    • Subdirectory (yourdomain.com/staging)

    • Separate server environment

  • Implementation:
    • Use WP Staging, Duplicator, or All-in-One WP Migration plugins for WordPress

    • For custom sites, use version control and deployment tools like Git, Jenkins, or GitHub Actions

    • Ensure environment variables are properly configured for each environment

  • Best Practices:
    • Password-protect staging sites (using .htaccess)

    • Block search engines with robots.txt

    • Use identical server configurations across environments

    • Implement a deployment workflow (Dev → Staging → Production)

    • Document environment differences in a README file

# Example .htaccess for password protecting staging site
AuthType Basic
AuthName "Staging Site"
AuthUserFile /path/to/.htpasswd
Require valid-user

Help me with this

Answer: Implement these security measures:

  • Keep WordPress core, themes, and plugins updated

  • Use strong passwords and 2FA (with plugins like Wordfence or Sucuri)

  • Implement WordPress Salts in wp-config.php (use https://api.wordpress.org/secret-key/1.1/salt/)

  • Limit login attempts with a security plugin

  • Change the default wp-admin URL using a plugin like WPS Hide Login

  • Use SSL/HTTPS across your entire site

  • Disable file editing in wp-config.php by adding: define('DISALLOW_FILE_EDIT', true);

  • Implement proper user roles and permissions

  • Regular backups with automated solutions like UpdraftPlus

  • Web Application Firewall (WAF) implementation

Help me with this

Website Performance

Answer: Common causes and solutions:

  • Largest Contentful Paint (LCP): Optimize server response time, implement resource prioritization, and optimize critical rendering path.

  • First Input Delay (FID): Reduce JavaScript execution time, break up long tasks, optimize event handlers.

  • Cumulative Layout Shift (CLS): Add width/height attributes to images, ensure ads/embeds have reserved space, and avoid inserting content above existing content.

Tools for diagnosis:

  • Google PageSpeed Insights

  • Chrome DevTools Performance tab

  • Lighthouse audits in Chrome

  • web.dev Measure tool

Help me with this

How can I improve my WordPress site's loading speed?

Answer: Implement these optimization techniques:

  • Enable caching with plugins like WP Rocket or W3 Total Cache

  • Use a CDN (Cloudflare, Bunny CDN) to distribute static assets

  • Optimize images with WebP format and lazy loading

  • Minify and combine CSS/JS files

  • Implement GZIP compression via .htaccess

  • Consider database optimization with WP-Optimize

  • Use a lightweight theme with minimal HTTP requests

// Example .htaccess code for browser caching
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/jpg "access plus 1 year"
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType image/gif "access plus 1 year"
  ExpiresByType image/png "access plus 1 year"
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType application/pdf "access plus 1 month"
  ExpiresByType text/javascript "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
  ExpiresByType application/x-javascript "access plus 1 month"
  ExpiresByType application/x-shockwave-flash "access plus 1 month"
  ExpiresByType image/x-icon "access plus 1 year"
  ExpiresDefault "access plus 2 days"
</IfModule>

Help me with this