Plugin Directory

Changeset 2985589


Ignore:
Timestamp:
10/29/2023 10:49:45 AM (2 years ago)
Author:
tiomking
Message:

Version 2.1:

  • Bug fix: Failure to delete ReWord plugin in PHP 8.2
  • Bug fix: Failure to report on URLs longer then 100 chars
  • Tested up to WordPress version 6.4
Location:
reword/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • reword/trunk

  • reword/trunk/class/class-reword-plugin.php

    r1857904 r2985589  
    2424
    2525    /**
    26      * Reword database creation.
    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.
    3131     *
    3232     * Reword table data parameters:
     
    4646        global $wpdb;
    4747        // SQL query to create reword table
    48         $sql = "CREATE TABLE IF NOT EXISTS " . REWORD_DB_NAME . " (
     48        $sql = "CREATE TABLE " . REWORD_DB_NAME . " (
    4949                    report_id int(25) NOT NULL AUTO_INCREMENT,
    5050                    mistake text NOT NULL,
     
    5353                    status enum('new','ignore') NOT NULL DEFAULT 'new',
    5454                    full_text text NOT NULL,
    55                     site_info varchar(100) NOT NULL,
     55                    site_info text NOT NULL,
    5656                    reports_count int(25) NOT NULL DEFAULT '1',
    5757                    PRIMARY KEY  (`report_id`),
     
    5959                ) ENGINE=MyISAM " . $wpdb->get_charset_collate() . " COMMENT='Reword mistakes reports' AUTO_INCREMENT=1;";
    6060
    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 ) {
    6265            // log error, deactivate and die
    6366            $this->reword_log( REWORD_ERR, $wpdb->last_error );
    6467            $this->reword_deactivate();
    6568            $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            }
    6674        }
    6775    }
     
    94102
    95103    /**
    96      * Upgrade plugin DB hook
     104     * Upgrade plugin DB and options hook
    97105     */
    98106    public function reword_update_check() {
     
    113121     * @global Object $wpdb
    114122     */
    115     private function reword_delete_db() {
     123    private static function reword_delete_db() {
    116124        global $wpdb;
    117125        // SQL query to delete reword table
     
    125133     * @global type $reword_options
    126134     */
    127     private function reword_options_delete() {
     135    private static function reword_options_delete() {
    128136        global $reword_options;
    129137        foreach ( array_keys( $reword_options ) as $option ) {
  • reword/trunk/readme.txt

    r2960009 r2985589  
    44Tags: mistakes, spellcheck, typo, report, error, fix
    55Requires at least: 4.7.4
    6 Tested up to: 6.3.1
     6Tested up to: 6.4
    77Requires PHP: 5.4
    88Stable tag: trunk
     
    2121
    2222== 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* Tested up to WordPress version 6.4
     27
    2328= 2.0 =
    2429* Set ReWord notice banner default to off
  • reword/trunk/reword.php

    r1992716 r2985589  
    44 * Plugin URI:   http://reword.000webhostapp.com/wordpress
    55 * 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.0
     6 * Version:      2.1
    77 * Author:       TiomKing
    88 * Author URI:   https://profiles.wordpress.org/tiomking
Note: See TracChangeset for help on using the changeset viewer.