Plugin Directory

Changeset 2727228


Ignore:
Timestamp:
05/20/2022 07:16:52 AM (4 years ago)
Author:
pressmate
Message:

Fixed access denied issue

Location:
makestories-helper/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • makestories-helper/trunk/helpers.php

    r2724665 r2727228  
    5454    }
    5555    if(isset($_POST['roles']) && is_array($_POST['roles'])){
    56         $options['roles'] = sanitize_text_field($_POST['roles']);
     56        $roles = [];
     57        foreach($_POST['roles'] as $role){
     58            $roles[] = sanitize_text_field($role);
     59        }
     60        $options['roles'] = $roles;
    5761    }
    5862    $options['to_rewrite'] = true;
  • makestories-helper/trunk/hooks.php

    r2724522 r2727228  
    1010function mscpt_register_amp_stories_post_type(){
    1111    $toRewrite = false;
    12     if(isset($_POST['mscpt_makestories_post_slug']) && !empty($_POST['mscpt_makestories_post_slug']) && current_user_can('administrator')){
     12    if(isset($_POST['mscpt_makestories_post_slug']) && !empty($_POST['mscpt_makestories_post_slug']) && current_user_can('administrator')){
    1313        check_admin_referer('mscpt_register_amp_stories_post_type');
    1414        $slug = sanitize_title($_POST['mscpt_makestories_post_slug'],'story');
     
    1818    }
    1919    $slug = ms_get_options();
    20     if($slug['to_rewrite']){
    21         $toRewrite = true;
    22         $slug['to_rewrite'] = false;
     20    if($slug['to_rewrite']){
     21        $toRewrite = true;
     22        $slug['to_rewrite'] = false;
    2323        update_option('mscpt_makestories_settings',$slug);
    2424    }
    25     if(!empty($slug) && isset($slug['post_slug']))
    26     {
     25    if(!empty($slug) && isset($slug['post_slug']))
     26    {
    2727        //register widget post type
    2828        register_post_type(
    29             MS_POST_WIDGET_TYPE,
     29            MS_POST_WIDGET_TYPE,
    3030            array(
    3131                'labels'=> array(
     
    4444        );
    4545
    46         register_post_type(
    47             MS_POST_TYPE,
     46        register_post_type(
     47            MS_POST_TYPE,
    4848            array(
    4949                'labels'=> array(
     
    7474            'parent_item' => __( 'Parent MS Category' ),
    7575            'parent_item_colon' => __( 'Parent MS Category:' ),
    76             'edit_item' => __( 'Edit MS Category' ), 
     76            'edit_item' => __( 'Edit MS Category' ),
    7777            'update_item' => __( 'Update MS Category' ),
    7878            'add_new_item' => __( 'Add New MS Category' ),
    7979            'new_item_name' => __( 'New MS Category Name' ),
    8080            'menu_name' => __( 'MS Category' ),
    81           );   
    82          
     81        );
     82
    8383        // Now register the taxonomy
    84           register_taxonomy(MS_TAXONOMY,MS_POST_TYPE, array(
     84        register_taxonomy(MS_TAXONOMY,MS_POST_TYPE, array(
    8585            'hierarchical' => false,
    8686            'labels' => $labels,
     
    8989            'show_admin_column' => true,
    9090            'query_var' => true,
    91               'rewrite' => array(
    92                   'slug' => ms_get_slug().'-category'
    93               )
    94           ));
    95 
    96     }else{
    97         //No option found for the options, show the modal to user to help him set options
     91            'rewrite' => array(
     92                'slug' => ms_get_slug().'-category'
     93            )
     94        ));
     95
     96    }else{
     97        //No option found for the options, show the modal to user to help him set options
    9898        add_action('admin_head','mscpt_makeStoriesHeaderScript');
    9999        add_action('admin_footer','mscpt_makeStoriesSlugModal');
    100     }
    101     if($toRewrite){
     100    }
     101    if($toRewrite){
    102102        flush_rewrite_rules();
    103103    }
     
    202202    $plugins['mytinymceplugin'] = MS_PLUGIN_BASE_URL.'assets/js/tiny-mce/tiny-mce.js';
    203203    return $plugins;
    204   }
    205  
     204}
     205
    206206function mscpt_tiny_mce_register_buttons( $buttons ) {
    207207    $newBtns = array(
     
    215215
    216216function mscpt_tiny_mce_new_buttons() {
    217   add_filter( 'mce_external_plugins', 'mscpt_tiny_mce_add_buttons' );
    218   add_filter( 'mce_buttons', 'mscpt_tiny_mce_register_buttons' );
     217    add_filter( 'mce_external_plugins', 'mscpt_tiny_mce_add_buttons' );
     218    add_filter( 'mce_buttons', 'mscpt_tiny_mce_register_buttons' );
    219219}
    220220
     
    225225    } else {
    226226        return MS_PLUGIN_BASE_PATH . '/templates' . '/' . $file;
    227     } 
     227    }
    228228}
    229229
     
    270270        ?>
    271271        <div class="grid" id="listing-grid">
    272         <?php
     272            <?php
    273273            foreach($value as $index=>$post) {
    274274                include mscpt_getTemplatePath("prepare-story-vars.php");
    275275                include mscpt_getTemplatePath("listing-story-grid.php");
    276276            }
    277         ?>
     277            ?>
    278278        </div>
    279279        <?php
     
    292292}
    293293
    294 add_action('wp_ajax_nopriv_more_post_ajax', 'mscpt_more_post_ajax'); 
     294add_action('wp_ajax_nopriv_more_post_ajax', 'mscpt_more_post_ajax');
    295295add_action('wp_ajax_more_post_ajax', 'mscpt_more_post_ajax');
    296296
     
    317317}
    318318
    319 add_action('wp_ajax_nopriv_load_post_data_ajax', 'mscpt_load_post_data_ajax'); 
     319add_action('wp_ajax_nopriv_load_post_data_ajax', 'mscpt_load_post_data_ajax');
    320320add_action('wp_ajax_load_post_data_ajax', 'mscpt_load_post_data_ajax');
    321321
  • makestories-helper/trunk/makestories.php

    r2724522 r2727228  
    44Plugin URI:     https://makestories.io/official-wordpress-webstories-plugin/
    55Description:    The leading Google Web Stories Editor is now available to create Stories in WordPress. It is easy to use, allows for extensive customization, and is adaptive for future changes.
    6 Version:        2.6.5
     6Version:        2.6.6
    77Author:         MakeStories Team
    88Author URI:     https://makestories.io
  • makestories-helper/trunk/pages/category-structure.php

    r2724522 r2727228  
    9797        </table>
    9898        </form>
     99<!--        <table class="form-table" role="presentation">-->
     100<!---->
     101<!--            <tbody>-->
     102<!--            <tr>-->
     103<!--                <td colspan="2">-->
     104<!--                    <hr/>-->
     105<!--                </td>-->
     106<!--            </tr>-->
     107<!--            <tr>-->
     108<!--                <th scope="row"><label>Update Story Media</label></th>-->
     109<!--                <td>-->
     110<!--                    <p class="description">If you think that your story media is not coming from your own domain, click this button. If all the things are already set, this will not affect you.</p>-->
     111<!--                    <p id="summary"></p>-->
     112<!--                    <p class="submit">-->
     113<!--                        <input type="submit" id="run-media-updates" name="submit" class="button button-primary" value="Run Updates"/>-->
     114<!--                    </p>-->
     115<!--                </td>-->
     116<!--            </tr>-->
     117<!--        </table>-->
    99118        <table class="form-table" role="presentation">
    100 
    101119            <tbody>
    102120            <tr>
     
    106124            </tr>
    107125            <tr>
    108                 <th scope="row"><label>Update Story Media</label></th>
    109                 <td>
    110                     <p class="description">If you think that your story media is not coming from your own domain, click this button. If all the things are already set, this will not affect you.</p>
    111                     <p id="summary"></p>
    112                     <p class="submit">
    113                         <input type="submit" id="run-media-updates" name="submit" class="button button-primary" value="Run Updates"/>
    114                     </p>
    115                 </td>
    116             </tr>
    117         </table>
    118         <table class="form-table" role="presentation">
    119             <tbody>
    120             <tr>
    121                 <td colspan="2">
    122                     <hr/>
    123                 </td>
    124             </tr>
    125             <tr>
    126126                <th scope="row"><label>Republish all stories</label></th>
    127127                <td>
    128                     <p class="description">This button re-publishes all the stories on your wordpress site. Helpful for bulk changes and in case you have not yet migrated from your old image urls.</p>
     128                    <p class="description">This button re-publishes all the stories on your wordpress site. Helpful for bulk changes to thinks like analytics and Monetization.</p>
    129129                    <p id="summary-republish"></p>
    130130                    <p class="submit">
  • makestories-helper/trunk/readme.txt

    r2724522 r2727228  
    44Requires at least: 4.0
    55Tested up to: 5.9.3
    6 Stable tag: 2.6.5
     6Stable tag: 2.6.6
    77Requires PHP: 5.6
    88
Note: See TracChangeset for help on using the changeset viewer.