1 year ago

#347957

test-img

alireza karmiyan

nothing happens when I run plugin

I wrote a plugin that included another plugin, but nothing happens when I run it. Please check this out and help me.

This is the first plugin, and this is the main plugin๐Ÿ‘‡

<?php
/*
Plugin Name: DB Testsed
Description: a simple plugin
Version: 1.0
Author: Ak
Text Domain: HOooooooo
// */
 include "ADT_db.php";
?>

This is the second plugin, which I added in the main plugin ๐Ÿ‘‡

<?php
function scratchcode_create_payment_table()
{
    global $wpdb;
    $table_name = $wpdb->prefix . "ADT";
    $charset_collate = $wpdb->get_charset_collate();
    $sql = "CREATE TABLE IF NOT EXISTS $table_name (
      id bigint(20) NOT NULL AUTO_INCREMENT,
      user_id bigint(20) UNSIGNED NOT NULL,
      created_at datetime NOT NULL,
      expires_at datetime NOT NULL,
      PRIMARY KEY id (id)
    ) $charset_collate;";
    require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    dbDelta($sql);
    addMenu();
}
register_activation_hook(__FILE__,'scratchcode_create_payment_table');

php

wordpress

wordpress-plugin-creation

0 Answers

Your Answer

Accepted video resources