Plugin Directory

Changeset 3136510


Ignore:
Timestamp:
08/16/2024 10:04:20 AM (20 months ago)
Author:
thangnv27
Message:
  • Fix security
  • Fix addquicktag
  • Update shortcode markid
  • Add support Google PageSpeed Insights
Location:
wp-multitasking/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • wp-multitasking/trunk/includes/addquicktag_cpt.php

    r1725723 r3136510  
    2424    if (isset($_GET['page']) and $_GET['page'] == 'wpmt_addquicktag') {
    2525        if (isset($_POST['action']) and 'save' == $_POST['action']) {
    26             if(isset($_POST["wpmt_cpt_addquicktag"]) && !empty($_POST["wpmt_cpt_addquicktag"])){
    27                 update_option("wpmt_cpt_addquicktag", json_encode($_POST["wpmt_cpt_addquicktag"]));
    28             }else{
    29                 delete_option("wpmt_cpt_addquicktag");
     26            if (isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'security_nonce')) {
     27                if(isset($_POST["wpmt_cpt_addquicktag"]) && !empty($_POST["wpmt_cpt_addquicktag"])){
     28                    update_option("wpmt_cpt_addquicktag", json_encode($_POST["wpmt_cpt_addquicktag"]));
     29                }else{
     30                    delete_option("wpmt_cpt_addquicktag");
     31                }
     32                header("Location: {$_SERVER['REQUEST_URI']}&saved=true");
     33                die();
    3034            }
    31             header("Location: {$_SERVER['REQUEST_URI']}&saved=true");
    32             die();
    3335        }
    3436    }
     
    4648                <?php
    4749                $post_types = get_post_types();
    48                 $exclude_types = array('post', 'page', 'revision', 'attachment', 'nav_menu_item', 'custom_css', 'customize_changeset', 'acf-field-group', 'acf-field');
     50                $exclude_types = array('post', 'page', 'attachment');
    4951                foreach ($post_types as $post_type) {
    5052                    if(in_array($post_type, $exclude_types)){
     
    6264</div>
    6365HTML;
    64                     }else{
     66                    }else if (is_post_type_viewable($post_type)){
    6567                        echo <<<HTML
    6668<div>
     
    7678                <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" />
    7779                <input type="hidden" name="action" value="save" />
     80                <?php wp_nonce_field('security_nonce'); ?>
    7881            </p>
    7982        </form>
  • wp-multitasking/trunk/includes/floating-popup/exit-popup.php

    r3014283 r3136510  
    153153    if (isset($_GET['page']) and $_GET['page'] == 'wpmt_exit_popup') {
    154154        if (isset($_REQUEST['action']) and 'save' == $_REQUEST['action']) {
     155          if (isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'security_nonce')) {
    155156            foreach ($wpmt_exit_fields as $field) {
    156157                if (isset($_REQUEST[$field])) {
     
    163164            header("Location: {$_SERVER['REQUEST_URI']}&saved=true");
    164165            die();
     166          }
    165167        }
    166168    }
     
    181183            ?>
    182184            <form method="post">
     185                <?php wp_nonce_field('security_nonce'); ?>
    183186                <input type="hidden" name="default_exit_init" value="1" />
    184187                <table class="exit-popup form-table">
  • wp-multitasking/trunk/includes/floating-popup/welcome-popup.php

    r3014283 r3136510  
    162162    if (isset($_GET['page']) and $_GET['page'] == 'wpmt_welcome_popup') {
    163163        if (isset($_REQUEST['action']) and 'save' == $_REQUEST['action']) {
     164          if (isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'security_nonce')) {
    164165            foreach ($wpmt_wcome_fields as $field) {
    165166                if (isset($_REQUEST[$field])) {
     
    172173            header("Location: {$_SERVER['REQUEST_URI']}&saved=true");
    173174            die();
     175          }
    174176        }
    175177    }
     
    190192            ?>
    191193            <form method="post">
     194                <?php wp_nonce_field('security_nonce'); ?>
    192195                <input type="hidden" name="default_wcome_init" value="1" />
    193196                <table class="welcome-popup form-table">
  • wp-multitasking/trunk/includes/header-footer-scripts.php

    r3027625 r3136510  
    3939      }
    4040      if (isset($_POST['action']) and 'save' == $_POST['action']) {
    41           $fields = ['wpmt_insert_header', 'wpmt_insert_body', 'wpmt_insert_footer'];
    42           foreach ($fields as $field) {
    43               if (isset($_REQUEST[$field]) and !empty($_REQUEST[$field])) {
    44                   update_option($field, $_REQUEST[$field]);
    45               } else {
    46                   delete_option($field);
     41          if (isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'security_nonce')) {
     42              $fields = ['wpmt_insert_header', 'wpmt_insert_body', 'wpmt_insert_footer'];
     43              foreach ($fields as $field) {
     44                  if (isset($_REQUEST[$field]) and !empty($_REQUEST[$field])) {
     45                      update_option($field, $_REQUEST[$field]);
     46                  } else {
     47                      delete_option($field);
     48                  }
    4749              }
    4850          }
     
    7375              <input name="save" type="submit" value="Save changes" class="button button-large button-primary" />
    7476              <input type="hidden" name="action" value="save" />
     77              <?php wp_nonce_field('security_nonce'); ?>
    7578          </div>
    7679      </form>
  • wp-multitasking/trunk/includes/permalinks.php

    r3027625 r3136510  
    5555
    5656        if (isset($_POST[$hidden_field_name]) && $_POST[$hidden_field_name] == 'Y') {
    57             $opt_val = preg_replace('/[^0-9a-z]+/i', '', $_POST[$opt_name]);
    58             update_option($opt_name, $opt_val);
    59             if(isset($_POST["ppo_cpt_slug"]) && !empty($_POST["ppo_cpt_slug"])){
    60                 update_option("cpt_without_slug", json_encode($_POST["ppo_cpt_slug"]));
    61             }else{
    62                 update_option("cpt_without_slug", json_encode(array()));
    63             }
    64             ?>
    65             <div class="updated"><p><strong><?php _e('Settings saved.'); ?></strong></p></div>
    66             <?php
    67             $this->rewrite_rules(true);
    68             $this->add_rules_htaccess();
     57            if (isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'security_nonce')) {
     58                $opt_val = preg_replace('/[^0-9a-z]+/i', '', $_POST[$opt_name]);
     59                update_option($opt_name, $opt_val);
     60                if(isset($_POST["ppo_cpt_slug"]) && !empty($_POST["ppo_cpt_slug"])){
     61                    update_option("cpt_without_slug", json_encode($_POST["ppo_cpt_slug"]));
     62                }else{
     63                    update_option("cpt_without_slug", json_encode(array()));
     64                }
     65                ?>
     66                <div class="updated"><p><strong><?php _e('Settings saved.'); ?></strong></p></div>
     67                <?php
     68                $this->rewrite_rules(true);
     69                $this->add_rules_htaccess();
     70            }
    6971        }
    7072        ?>
     
    7274        <h2>Permalink custom post type</h2>
    7375        <form name="form1" method="post" action="">
     76            <?php wp_nonce_field('security_nonce'); ?>
    7477            <input type="hidden" name="<?php echo $hidden_field_name; ?>" value="Y">
    7578            <h3>Strip slug from custom post type:</h3>
  • wp-multitasking/trunk/includes/shortcode_markid.php

    r831023 r3136510  
    66function wpmt_markid($atts) {
    77    extract(shortcode_atts(array(
    8                 "id" => ''
     8                "id" => '',
     9                "title" => ''
    910            ), $atts ));
    10     return "<span id=\"$id\"></span>";
     11    if (!empty($title)) {
     12        return "<span id=\"".esc_html($id)."\" class=\"mark\">".esc_html($title)."</span>";
     13    }
     14    return "<span id=\"".esc_html($id)."\"></span>";
    1115}
    1216
  • wp-multitasking/trunk/includes/smtp.php

    r2964791 r3136510  
    3737    }
    3838    if (isset($_POST['action']) and 'save' == $_POST['action']) {
    39         $fields = ['wpmt_smtp_from', 'wpmt_smtp_fromname', 'wpmt_smtp_host', 'wpmt_smtp_user', 'wpmt_smtp_passwd', 'wpmt_smtp_port', 'wpmt_smtp_secure'];
    40         foreach ($fields as $field) {
    41             if (isset($_REQUEST[$field]) and !empty($_REQUEST[$field])) {
    42                 update_option($field, $_REQUEST[$field]);
    43             } else {
    44                 delete_option($field);
     39        if (isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'security_nonce')) {
     40            $fields = ['wpmt_smtp_from', 'wpmt_smtp_fromname', 'wpmt_smtp_host', 'wpmt_smtp_user', 'wpmt_smtp_passwd', 'wpmt_smtp_port', 'wpmt_smtp_secure'];
     41            foreach ($fields as $field) {
     42                if (isset($_REQUEST[$field]) and !empty($_REQUEST[$field])) {
     43                    update_option($field, $_REQUEST[$field]);
     44                } else {
     45                    delete_option($field);
     46                }
    4547            }
    4648        }
     
    135137            <input name="save" type="submit" value="Save changes" class="button button-large button-primary" />
    136138            <input type="hidden" name="action" value="save" />
     139            <?php wp_nonce_field('security_nonce'); ?>
    137140        </div>
    138141    </form>
  • wp-multitasking/trunk/js/shortcode_markid.js

    r831023 r3136510  
    55            // Register command for when button is clicked
    66            ed.addCommand('markid', function() {
    7                 content = '[markid id="Nhap_ten_ID"]';
     7                content = '[markid id="Selector_ID" title=""]';
    88
    99                tinymce.execCommand('mceInsertContent', false, content);
  • wp-multitasking/trunk/readme.txt

    r3087160 r3136510  
    22Contributors: thangnv27
    33Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6ADQPKM8RFF4A
    4 Tags: shorcode,mark id,bbcode,welcome popup,exit popup,popup,addquicktag,custom post type,post type,remove base slug
     4Tags: Google PageSpeed Insights,shorcode,mark id,bbcode,welcome popup,exit popup,popup,addquicktag,custom post type,post type,remove base slug
    55Requires at least: 2.1.0
    66Tested up to: 6.4.2
    7 Stable tag: 0.1.12
     7Stable tag: 0.1.13
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2626* Shortcodes: [currentyear], [currentmonth] ... support YoastSEO, RankMath
    2727* Insert head, body and footer scripts
     28* Support Google PageSpeed Insights for green scores
    2829
    2930== Installation ==
     
    7172Named Spoiler: [spoiler=two plus two]four[/spoiler]
    7273Unnamed Spoiler: [spoiler]Boo![/spoiler]
     74Mark ID: [markid id="Selector_ID" title=""]
    7375
    7476== Screenshots ==
     
    8385
    8486== Changelog ==
     87
     88= 0.1.13 =
     89* Fix security
     90* Fix addquicktag
     91* Update shortcode markid
     92* Add support Google PageSpeed Insights
    8593
    8694= 0.1.12 =
  • wp-multitasking/trunk/wp-multitasking.php

    r3087160 r3136510  
    44Plugin URI:  http://wordpress.org/plugins/wp-multitasking/
    55Description: This plugin is synthetic utility for your WordPress site: Shortcode, BBCode, AddQuickTag, Exit pop-up, Welcome pop-up, Remove base slug, SMTP, Classic Editor, Classic widgets...
    6 Version:     0.1.12
     6Version:     0.1.13
    77Author:      thangnv27
    88Author URI:  https://ngothang.me/
     
    4242    if (isset($_GET['page']) and $_GET['page'] == WPMT_MENU_ID) {
    4343        if (isset($_POST['action']) and 'save' == $_POST['action']) {
    44             $fields = ['wpmt_menu_name', 'wpmt_classic_editor', 'wpmt_classic_widgets', 'wpmt_popup_type', 'wpmt_colorbox_type'];
    45             foreach ($fields as $field) {
    46                 if (isset($_REQUEST[$field]) and !empty($_REQUEST[$field])) {
    47                     update_option($field, $_REQUEST[$field]);
    48                 } else {
    49                     delete_option($field);
     44            if (isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'security_nonce')) {
     45                $fields = ['wpmt_menu_name', 'wpmt_classic_editor', 'wpmt_classic_widgets', 'wpmt_popup_type', 'wpmt_colorbox_type'];
     46                foreach ($fields as $field) {
     47                    if (isset($_REQUEST[$field]) and !empty($_REQUEST[$field])) {
     48                        update_option($field, $_REQUEST[$field]);
     49                    } else {
     50                        delete_option($field);
     51                    }
    5052                }
     53
     54                header("Location: {$_SERVER['REQUEST_URI']}&saved=true");
     55                die();
    5156            }
    52 
    53             header("Location: {$_SERVER['REQUEST_URI']}&saved=true");
    54             die();
    5557        }
    5658    }
     
    135137                    <input name="save" type="submit" value="Save changes" class="button button-large button-primary" />
    136138                    <input type="hidden" name="action" value="save" />
     139                    <?php wp_nonce_field('security_nonce'); ?>
    137140                </div>
    138141            </form>
     
    185188require_once WPMT_PLUGIN_DIR . '/includes/shortcodes.php';
    186189require_once WPMT_PLUGIN_DIR . '/includes/header-footer-scripts.php';
     190require_once WPMT_PLUGIN_DIR . '/includes/pagespeed-insights.php';
Note: See TracChangeset for help on using the changeset viewer.