Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter ablamohamedamine

    (@ablamohamedamine)

    Hi again @dpinson ;

    1-I make sure that the recomendation is good in my host and I activate the debug, any issue was displayed, I always should upload the demo twice.

    2-It works thank you, but “My Account” page get the ID of an other page, I don’t know why.

    Anyway here’s the file’s code to check it if you can:

    ?function dziridemo_ocdi_plugin_notice() {

    ? ? $installed_plugins = get_plugins();

    ? ? if ( !isset( $installed_plugins['one-click-demo-import/one-click-demo-import.php'] ) ) {

    ? ? ? ? $install_url = wp_nonce_url(

    ? ? ? ? ? ? self_admin_url( 'update.php?action=install-plugin&plugin=one-click-demo-import/one-click-demo-import.php' ),

    ? ? ? ? ? ? 'install-plugin_one-click-demo-import/one-click-demo-import.php/one-click-demo-import.php');

    ? ? ? ? ?>

    ? ? ? ? ? ? <div class="notice error is-dismissible">

    ? ? ? ? ? ? ? ? <p><?php echo __( 'The plugin <strong> Dziri Demo </strong> require One Click Demo Import' ); ?></p>

    ? ? ? ? ? ? ? ? <p><a href="<?php echo esc_url( $install_url ); ?>" class="button-primary"><?php echo __( 'Install One Click Demo Import' ); ?></a></p>

    ? ? ? ? ? ? </div>

    ? ? ? ? <?php

    ? ? }

    ? ? else if ( ! is_plugin_active( 'one-click-demo-import/one-click-demo-import.php' ) ) {

    ? ? ? ? $activate_url = wp_nonce_url(

    ? ? ? ? ? ? self_admin_url( 'plugins.php?action=activate&plugin=one-click-demo-import/one-click-demo-import.php' ),

    ? ? ? ? ? ? 'activate-plugin_one-click-demo-import/one-click-demo-import.php');

    ? ? ? ? ?>

    ? ? ? ? ? ? <div class="notice notice-warning is-dismissible">

    ? ? ? ? ? ? ? ? <p><?php echo __( 'One Click Demo Import is installed but not activated. Please activate One Click Demo Import to use th plugin <strong> Dziri Demo </strong>' ); ?></p>

    ? ? ? ? ? ? ? ? <p><a href="<?php echo esc_url( $activate_url ); ?>" class="button-primary"><?php echo __( 'Activate One Click Demo Import' ); ?></a></p>

    ? ? ? ? ? ? </div>

    ? ? ? ? <?php

    ? ? }

    }

    add_action( 'admin_notices', 'dziridemo_ocdi_plugin_notice' );

    // One Click Demo Import Plugins

    function dziridemo_register_required_plugins( $plugins ) {

    ? ? $theme_plugins = [

    ? ? ? ? [ // WooCommerce

    ? ? ? ? ? ? 'name' ? ? => 'WooCommerce',

    ? ? ? ? ? ? 'slug' ? ? => 'woocommerce',

    ? ? ? ? ? ? 'required' => true

    ? ? ? ? ],

    ? ? ? ? [ // Contact Form 7

    ? ? ? ? ? ? 'name' ? ? => 'Contact Form 7',

    ? ? ? ? ? ? 'slug' ? ? => 'contact-form-7',

    ? ? ? ? ? ? 'required' => true

    ? ? ? ? ],

    ? ? ];

    ? ? return array_merge( $plugins, $theme_plugins );

    }

    add_filter( 'ocdi/register_plugins', 'dziridemo_register_required_plugins' );

    // Remove Pages

    function dziridemo_remove_pages( $selected_import ) {

    ? ? $pages = get_posts( array(

    ? ? ? ? 'post_type' => 'page',

    ? ? ? ? 'numberposts' => -1,

    ? ? ? ? 'post_status' => 'any'

    ? ? ));

    ? ? foreach ($pages as $page) {

    ? ? ? ? wp_delete_post($page->ID, true);

    ? ? }

    }

    add_action( 'ocdi/before_content_import', 'dziridemo_remove_pages' );

    // Remove Sidebares Content

    function dziridemo_before_widgets_import( $selected_import ) {

    ? ? $sidebars_widgets = get_option('sidebars_widgets');

    ? ? foreach ($sidebars_widgets as $sidebar_id => $widgets) {

    ? ? ? ? if ($sidebar_id != 'wp_inactive_widgets') {

    ? ? ? ? ? ? $sidebars_widgets[$sidebar_id] = array();

    ? ? ? ? }

    ? ? }

    ? ? update_option('sidebars_widgets', $sidebars_widgets);

    }

    add_action( 'ocdi/before_widgets_import', 'dziridemo_before_widgets_import' );

    function dziridemo_import_demo() {

    ? ? return [

    ? ? ? ? [

    ? ? ? ? ? ? 'import_file_name' ? ? ? ? ? => 'Dziri Demo',

    ? ? ? ? ? ? 'import_file_url' ? ? ? ? ? ?=> plugin_dir_url(__FILE__) . '/demo/dziri.WordPress.xml',

    ? ? ? ? ? ? 'import_widget_file_url' ? ? => plugin_dir_url(__FILE__) . '/demo/dziri.widgets.wie',

    ? ? ? ? ? ? 'import_customizer_file_url' => plugin_dir_url(__FILE__) . '/demo/dziri-export.dat',

    ? ? ? ? ? ? 'import_preview_image_url' ? => plugin_dir_url(__FILE__) . '/demo/dziri-screenshot.png',

    ? ? ? ? ? ? 'preview_url' ? ? ? ? ? ? ? ?=> 'https://dziri.teamine.agency/',

    ? ? ? ? ],

    ? ? ];

    }

    add_filter( 'ocdi/import_files', 'dziridemo_import_demo' );

    // One Click Demo Import Settings

    function dziridemo_after_import_setup() {

    ? ? $main_menu = get_term_by( 'name', 'Main Menu', 'nav_menu' );

    ? ? set_theme_mod( 'nav_menu_locations', array(

    ? ? ? ? ? ? 'header-menu' => $main_menu->term_id,

    ? ? ? ? )

    ? ? );

    ? ? update_option( 'show_on_front', 'page' );

    ? ? $pages = get_pages();

    ? ? foreach ($pages as $page) {

    ? ? ? ? switch ($page->post_title) {

    ? ? ? ? ? ? case 'Home':

    ? ? ? ? ? ? ? ? update_option('page_on_front', $page->ID);

    ? ? ? ? ? ? ? ? break;

    ? ? ? ? ? ? case 'Blog':

    ? ? ? ? ? ? ? ? update_option('page_for_posts', $page->ID);

    ? ? ? ? ? ? ? ? break;

    ? ? ? ? ? ? case 'Cart':

    ? ? ? ? ? ? ? ? update_option('woocommerce_cart_page_id', $page->ID);

    ? ? ? ? ? ? ? ? break;

    ? ? ? ? ? ? case 'Checkout':

    ? ? ? ? ? ? ? ? update_option('woocommerce_checkout_page_id', $page->ID);

    ? ? ? ? ? ? ? ? break;

    ? ? ? ? ? ? case 'My Account':

    ? ? ? ? ? ? ? ? update_option('woocommerce_myaccount_page_id', $page->ID);

    ? ? ? ? ? ? ? ? break;

    ? ? ? ? ? ? case 'Terms and Conditions':

    ? ? ? ? ? ? ? ? update_option('woocommerce_terms_page_id', $page->ID);

    ? ? ? ? ? ? ? ? break;

    ? ? ? ? }

    ? ? }

    }

    add_action( 'ocdi/after_import', 'dziridemo_after_import_setup' );

    Thread Starter ablamohamedamine

    (@ablamohamedamine)

    Dear @dpinson ; thanks a lot for your answers an efforts.

    I’ll try why you suggest for me and come back to you as soon as possible.

    Regards.

    Amine.

    Forum: Fixing WordPress
    In reply to: Can’t login
    Thread Starter ablamohamedamine

    (@ablamohamedamine)

    I tried using other devices yes, and I download the project and install it on the Local WP, but the same results.

    Forum: Fixing WordPress
    In reply to: Can’t login
    Thread Starter ablamohamedamine

    (@ablamohamedamine)

    There’s no error message displayed, that’s why I’m wondering.

    I delete all my plugin from the file manager, but the issue persist before uploading them again.

    Forum: Fixing WordPress
    In reply to: Can’t login
    Thread Starter ablamohamedamine

    (@ablamohamedamine)

    Thanks for your answer @threadi ; even this method doesn’t work.

Viewing 5 replies - 1 through 5 (of 5 total)