php – Creating multiple tables with Plugin

I opened a new question, just to be sure. The former request has partly been resolved.
I got another question regarding creating tables for wordpress: Only one table is created (The first one), but the others not. Does somebody know why?

My Code now looks like this:

function artok_activate(){
    global $wpdb;
    require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    $charset_collate                = $wpdb->get_charset_collate();
    $table_Veranstaltung            = $wpdb->prefix . 'Veranstaltung';
    $table_Personen                 = $wpdb->prefix . 'Personen';
    $table_Sponsor                  = $wpdb->prefix . 'Sponsor';
    $table_SponKunde                = $wpdb->prefix . 'SponKunde';
    
    if( $wpdb->get_var( "SHOW TABLES LIKE '$table_Veranstaltung'" ) != $table_Veranstaltung ) {
        $tableVer_Crea = 'CREATE TABLE ' . $table_Veranstaltung . '(
        ver_id int(11) NOT NULL AUTO_INCREMENT, 
        VeranstaltungName varchar(255), 
        PRIMARY KEY  (ver_id)
        )' . $charset_collate . ';';
        dbDelta( $tableVer_Crea );
        $success = empty($wpdb->last_error);
        
        return $success;
    }
    
    if( $wpdb->get_var( "SHOW TABLES LIKE '$table_Personen'" ) != $table_Personen ) {
        $tablePers_Crea = "CREATE TABLE " . $table_Personen . "(
        pers_id int(11) NOT NULL AUTO_INCREMENT, 
        Datum DATE, 
        Passwort varchar(255) UNIQUE, 
        Vorname varchar(255), 
        Nachname varchar(255), 
        Anrede varchar(255), 
        LoeschDatum DATE, 
        fkVer_id int(11), 
        FOREIGN KEY(fkVer_id) REFERENCES wp_Veranstaltung(Ver_id), 
        PRIMARY KEY  (pers_id)
        )" . $charset_collate . ";";
        
        dbDelta($tablePers_Crea);
        
        $success = empty($wpdb->last_error);
        
        return $success;
    }
    
    if( $wpdb->get_var( "SHOW TABLES LIKE '$table_Sponsor'" ) != $table_Sponsor) {
        $tableSp_Crea = "CREATE TABLE " . $table_Sponsor . "(
        sp_id int(11) NOT NULL AUTO_INCREMENT, 
        Code varchar(255), 
        Name varchar(255), 
        PRIMARY KEY  (sp_id)
        )" . $charset_collate . ";";
        dbDelta( $tableSp_Crea );
        $success = empty($wpdb->last_error);
        
        return $success;
    }
    
    if( $wpdb->get_var( "SHOW TABLES LIKE '$table_SponKunde'" ) != $table_SponKunde ) {
        $tableSpKu_Crea = "CREATE TABLE " . $table_SponKunde . "(
        fkPers_id int(11), 
        fkSp_id int(11), 
        FOREIGN KEY(fkPers_id) REFERENCES wp_Personen(pers_id), 
        FOREIGN KEY(fkSp_id) REFERENCES wp_Sponsor(sp_id)
        )" . $charset_collate . ";";
        dbDelta( $tableSpKu_Crea );
        $success = empty($wpdb->last_error);
        
        return $success;
    }
}   
    register_activation_hook( __FILE__, 'artok_activate' );

plugin contact form 7 – How to properly connect mailchimp to my ContactForm7?

I wonder how to connect mailchimp with ContactForm7 for automatic responds when you click the subscribe button?
Where is a link to my site: https://www.cyrcl.eu
I want to make a good looking respond for my customers.
Probably i’m missing where to put tag to connect them or something…
I already have put the mailchimp API in the ChampMatic Lite addon in my contactform.
Thank you in advice :]

How to pull code snippet from functionality plugin?

I have a functionality plugin to extend an existing (original) plugin. (Before I was just forking, but after the update of the original plugin it became clear that it is not a good practice.) I saved the code snippets I used when forking, and want to add them to the original plugin.

I found a hook here in the original plugin:

<?php do_action( 'es_wishlist_add_button', get_the_ID() ); ?>

And I’d like to place this code:

<?php if ( $es_settings->share_facebook ) : ?>
        <a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=<?php the_permalink(); ?>"><i class="fa fa-facebook" aria-hidden="true"></i></a>
    <?php endif; ?>
    <?php if ( $es_settings->share_twitter ) : ?>
        <a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=<?php the_permalink(); ?>"><i class="fa fa-twitter" aria-hidden="true"></i></a>
    <?php endif; ?>
    <?php if ( $es_settings->share_google_plus ) : ?>
        <a class="a2a_button_google_plus" href="https://www.addtoany.com/add_to/facebook?linkurl=<?php the_permalink(); ?>"><i class="fa fa-google-plus" aria-hidden="true"></i></a>
    <?php endif; ?><?php if ( $es_settings->share_linkedin ) : ?>
        <a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/facebook?linkedin=<?php the_permalink(); ?>"><i class="fa fa-linkedin" aria-hidden="true"></i></a>
    <?php endif; ?>
    <?php if ( $es_settings->use_pdf ) : ?>
        <a href="<?php echo add_query_arg( "es-pdf", get_the_ID(), get_the_permalink() ); ?>" target="_blank"><i class="fa fa-file-pdf-o" aria-hidden="true"></i></a>
    <?php endif; ?>

I use this in the functional plugin’s functions.php:

function epf_extra_buttons() {
    echo '<?php if ( $es_settings->share_facebook ) : ?>
        <a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=<?php the_permalink(); ?>"><i class="fa fa-facebook" aria-hidden="true"></i></a>
    <?php endif; ?>
    <?php if ( $es_settings->share_twitter ) : ?>
        <a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=<?php the_permalink(); ?>"><i class="fa fa-twitter" aria-hidden="true"></i></a>
    <?php endif; ?>
    <?php if ( $es_settings->share_google_plus ) : ?>
        <a class="a2a_button_google_plus" href="https://www.addtoany.com/add_to/facebook?linkurl=<?php the_permalink(); ?>"><i class="fa fa-google-plus" aria-hidden="true"></i></a>
    <?php endif; ?><?php if ( $es_settings->share_linkedin ) : ?>
        <a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/facebook?linkedin=<?php the_permalink(); ?>"><i class="fa fa-linkedin" aria-hidden="true"></i></a>
    <?php endif; ?>
    <?php if ( $es_settings->use_pdf ) : ?>
        <a href="<?php echo add_query_arg( "es-pdf", get_the_ID(), get_the_permalink() ); ?>" target="_blank"><i class="fa fa-file-pdf-o" aria-hidden="true"></i></a>
    <?php endif; ?>';
}

add_action('es_wishlist_add_button','epf_extra_buttons');

However, I do not receive the expected result. What do I do wrong?

plugin development – What’s the right way to tell if a block is rendered in the editor from a front-end/public script?

I’m writing a block that generates a skeleton via server-side render, and then populates the skeleton via React from a public-facing script (i.e., one that loads both on the front-end and the admin side of things). This works fine on the front-end, because the server-side render is triggered … from the server side. So, when the DOM is loaded, I can look for my skeleton, and then insert my React component. However, when in the editor, the server-side render is triggered via ServerSideRender in the block’s edit function, and the content is returned by API; so, the blocks aren’t yet rendered when the DOM is done loading. To work around this, I set a MutationObserver on the editor, and watch for my skeleton(s) to arrive. This seems inelegant. The below code works, but a) is it the Right Way to do this; and b) if it is, when (if ever) is it safe for me to remove the observer?

document.addEventListener("DOMContentLoaded", (event) => {
        let myEls = document.getElementsByClassName("my_class");

        if (myEls.length > 0) {
                for (let myEl of myEls) {
                        render(<MyReactComponent />, myEl);
                }
        } else {
                //we're on an admin page, and the my_class divs arrive
                //later via API call, so we have to watch for their creation
                let editorDiv = document.getElementById("editor");

                const config = { childList: true, subtree: true };

                const callback = (mutationList, observer) => {
                        for (let mutation of mutationList) {
                                if (mutation.type === 'childList' &&
                                    mutation.addedNodes.length > 0 &&
                                    mutation.addedNodes(0).querySelector(
                                        ".my_class")) {
                                        let myContainer =
                                            mutation.addedNodes(0);
                                        let myChild =
                                            myContainer.querySelector(
                                                ".my_class");
                                        render(<MyReactComponent />, myChild);
                                }
                        }
                }

                const observer = new MutationObserver(callback);
                observer.observe(document.getElementById(editorDiv.id),
                    config);

        }

});

WordPress page optimization and set up yoast SEO plugin for $10

WordPress page optimization and set up yoast SEO plugin

I will do on-page optimization and WordPress Yoast SEO plugin

SEO plays a vital role in SERP. Except for the term you can’t get a good rank in Google SERP. To be ranked in the top position get traffic for your site you come on the right platform.

Do you want to improve your search appearance on google?
If yes, this is the perfect place.

if you want to rank on Google search engine, on-page SEO is very important for you.

Also, I will handpick the best keywords for your website with my professional tools if you want.
Why choose me?

  • Optimize pages with keywords
  • Heading tag optimization
  • H1,H2 & H3 tags setup
  • TitleOptimization
  • Meta Description
  • ImageAlt Tags
  • BestPremium yoast settings configure.
  • Pages and posts on page Optimization
  • Setup Google Analytics
  • Site submission on Google, Yahoo, Bing
  • Permalinks structure changing and URL Optimization
  • Sitemap
  • Setup Google Search Console

For unlimited traffic on your site & to get more customers, to be ranked on top in google feel free to contact me!

Trustworthy work, You may Order Now!

.

WordPress looking for plugin that exports list of anyone who changed their password

I am looking for a plugin that will list all users who changed their password. listing the user name and date/time their password was changed. As well as the method if it was via the forgot password function or via the my profile page .

This would be for audit/reporting purposes. Does anyone know of such a plugin?

customization – how to find a book by it’s name using mybooktable plugin?

i know there are some short codes to use to show one specific book like [ mybooktable book=”book_name”] but is there a way using this plugin to look for a book by it’s name like the user enters the book name ??

php – wp_dequeue_script for a Plugin

I am trying to remove a line of script in the footer of my page that a plugin is inserting on pages that I am not using the plugin at, homepage for example. I am using the below code for some reason it will still display the script. Any suggestions?

The line I need removed: <script type='text/javascript' src='https://domain.com/wp-content/plugins/jet-reviews/assets/js/lib/vue.min.js?ver=2.6.11' id='jet-vue-js'></script>

The code in my functions.php

function review_enqueue() {
    if (is_front_page()) {
       wp_dequeue_script('jet-vue-js');
    }
}
add_action('wp_dequeue_scripts', 'review_enqueue');

Error in Autoptimize Plugin – WordPress Development Stack Exchange

I am getting this error in our Autoptimize plugin.

Error: Element style not allowed as child of element noscript in this context. (Suppressing further errors from this subtree.)

Does anyone know how to fix it?

Thank you!

Sandy

9 – The “Array” plugin does not exist after saving the order type form in Commerce

After saving any order type, the following error shows:

DrupalComponentPluginExceptionPluginNotFoundException: The "Array" plugin does not exist. Valid plugin IDs for Drupalstate_machineWorkflowManager are: invoice_default, order_default, order_default_validation, order_fulfillment, order_fulfillment_validation, payment_default, payment_manual, shipment_default in DrupalCorePluginDefaultPluginManager->doGetDefinition() (line 53 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

Any ideas?