Changeset 2984306
- Timestamp:
- 10/26/2023 09:49:01 AM (2 years ago)
- Location:
- reword/branches/dev
- Files:
-
- 3 edited
-
class/class-reword-plugin.php (modified) (7 diffs)
-
readme.txt (modified) (2 diffs)
-
reword.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
reword/branches/dev/class/class-reword-plugin.php
r1857904 r2984306 24 24 25 25 /** 26 * Reword database creat ion.27 * 28 * This function creates reword data table if does not exist .29 * Database table is deleted only when reword plugin is removed, 30 * but not when deactivated,to keep reports and settings data.26 * Reword database creat or update. 27 * 28 * This function creates reword data table if does not exist, or update db schema if needed. 29 * Database table is deleted only when reword plugin is removed, but not when deactivated, 30 * to keep reports and settings data. 31 31 * 32 32 * Reword table data parameters: … … 46 46 global $wpdb; 47 47 // SQL query to create reword table 48 $sql = "CREATE TABLE IF NOT EXISTS" . REWORD_DB_NAME . " (48 $sql = "CREATE TABLE " . REWORD_DB_NAME . " ( 49 49 report_id int(25) NOT NULL AUTO_INCREMENT, 50 50 mistake text NOT NULL, … … 53 53 status enum('new','ignore') NOT NULL DEFAULT 'new', 54 54 full_text text NOT NULL, 55 site_info varchar(100)NOT NULL,55 site_info text NOT NULL, 56 56 reports_count int(25) NOT NULL DEFAULT '1', 57 57 PRIMARY KEY (`report_id`), … … 59 59 ) ENGINE=MyISAM " . $wpdb->get_charset_collate() . " COMMENT='Reword mistakes reports' AUTO_INCREMENT=1;"; 60 60 61 if ( false === $wpdb->query( $sql ) || $wpdb->last_error ) { 61 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 62 $db_changes = dbDelta($sql); 63 64 if ( $wpdb->last_error ) { 62 65 // log error, deactivate and die 63 66 $this->reword_log( REWORD_ERR, $wpdb->last_error ); 64 67 $this->reword_deactivate(); 65 68 $this->reword_die( 'Reword failed to create DB' ); 69 } else if ( $db_changes ) { 70 // DB was created or updated 71 foreach ( $db_changes as $db_change) { 72 $this->reword_log( REWORD_NOTICE, $db_change ); 73 } 66 74 } 67 75 } … … 94 102 95 103 /** 96 * Upgrade plugin DB hook104 * Upgrade plugin DB and options hook 97 105 */ 98 106 public function reword_update_check() { … … 113 121 * @global Object $wpdb 114 122 */ 115 private function reword_delete_db() {123 private static function reword_delete_db() { 116 124 global $wpdb; 117 125 // SQL query to delete reword table … … 125 133 * @global type $reword_options 126 134 */ 127 private function reword_options_delete() {135 private static function reword_options_delete() { 128 136 global $reword_options; 129 137 foreach ( array_keys( $reword_options ) as $option ) { -
reword/branches/dev/readme.txt
r2960009 r2984306 4 4 Tags: mistakes, spellcheck, typo, report, error, fix 5 5 Requires at least: 4.7.4 6 Tested up to: 6. 3.16 Tested up to: 6.4 7 7 Requires PHP: 5.4 8 8 Stable tag: trunk … … 21 21 22 22 == Changelog == 23 = 2.1= 24 * Bug fix: Failure to delete ReWord plugin in PHP 8.2 25 * Bug fix: Failure to report on URLs longer then 100 chars 26 23 27 = 2.0 = 24 28 * Set ReWord notice banner default to off -
reword/branches/dev/reword.php
r1992716 r2984306 4 4 * Plugin URI: http://reword.000webhostapp.com/wordpress 5 5 * Description: This plugin allows readers to suggest fixes for content mistakes in your site. Intuitive frontend UI lets users report mistakes and send them to Administrator. Just mark mistake text, click on “R” icon, add your fix and send it. The reports admin page displays all reported mistakes, and lets admin fix them, or ignore them. Admin can also set the number of alerts before showing a report, to ensure accurate reports and real issues detection. 6 * Version: 2. 06 * Version: 2.1 7 7 * Author: TiomKing 8 8 * Author URI: https://profiles.wordpress.org/tiomking
Note: See TracChangeset
for help on using the changeset viewer.