Issues with Plugin Activation – Database Table Creation
-
Hello,
I’m experiencing issues with the activation of the “Widgets for Google Reviews” plugin on my WordPress site. During the activation process, I receive the following error:
see image: https://snipboard.io/k9F8WB.jpg
Plugin activation failed because the required database tables could not be created!
We got the following error from the database:
Run the following SQL codes in your database administration interface (e.g., PhpMyAdmin) to create the tables:
CREATE TABLE JwIOM1_trustindex_google_reviews (id
TINYINT(1) NOT NULL AUTO_INCREMENT,hidden
TINYINT(1) NOT NULL DEFAULT 0,user
VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci,user_photo
TEXT,text
TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,rating
DECIMAL(3,1),highlight
VARCHAR(11),date
DATE,reviewId
TEXT,reply
TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
PRIMARY KEY (id
)
)
Then try activating the plugin again.Steps I’ve Taken:
- I accessed the
schema.php
file and addedIF NOT EXISTS
to the SQL command to avoid errors if the table already exists. Here is the modified SQL command:
$ti_db_schema = [
‘reviews’ => “
CREATE TABLE IF NOT EXISTS “. $this->get_tablename(‘reviews’) .” (id
TINYINT(1) NOT NULL AUTO_INCREMENT,hidden
TINYINT(1) NOT NULL DEFAULT 0,user
VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci,user_photo
TEXT,text
TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,rating
DECIMAL(3,1),highlight
VARCHAR(11),date
DATE,reviewId
TEXT,reply
TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
PRIMARY KEY (id
)
)
“
];2. I verified that the configuration settings of my site are identical to those of other sites on the same server where the plugin works without issues.
Despite these steps, the plugin still fails to activate and the same errors persist.Request for Assistance:
Could you please assist me in resolving these issues? Specifically, I would like guidance on the correct configuration of database table creation during plugin activation.
Any help or suggestions would be greatly appreciated.
Thank you very much!
Best regards,
DavidThe page I need help with: [log in to see the link]
- I accessed the
- You must be logged in to reply to this topic.