Plugin Directory

Changeset 2909963


Ignore:
Timestamp:
05/09/2023 07:17:11 AM (3 years ago)
Author:
gqevu6bsiz
Message:

1.21.1 2023-05-09

  • Fixed: Misalignment of admin sidebar menu on mobile.
  • Fixed: Hidden avatar icon on Site Editor.
  • Fixed: Some security update(XSS vulnerability).
Location:
my-wp/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • my-wp/trunk/assets/css/admin-sidebar.css

    r2677466 r2909963  
    5656  body.wp-admin.mywp.auto-fold #adminmenu li.mywp-sidebar-item .mywp-sidebar-item-childs {
    5757    width: auto;
     58  }
     59  body.wp-admin.mywp.auto-fold #adminmenu li.mywp-sidebar-item.wp-has-submenu:hover .mywp-sidebar-item-childs {
     60    position: static;
     61    left: 0;
    5862  }
    5963}
  • my-wp/trunk/controller/modules/mywp.controller.module.admin.site-editor.php

    r2890935 r2909963  
    9090      display: none;
    9191    }
     92    #site-editor .edit-site-layout__view-mode-toggle.components-button .edit-site-layout__view-mode-toggle-icon {
     93      display: none;
     94    }
    9295    </style>
    9396
  • my-wp/trunk/mywp.php

    r2890935 r2909963  
    44Plugin URI: https://mywpcustomize.com/
    55Description: My WP is powerful admin and frontend customize and debug and extendable plugin.
    6 Version: 1.21.0
     6Version: 1.21.1
    77Author: gqevu6bsiz
    88Author URI: http://gqevu6bsiz.chicappa.jp/
     
    4343
    4444    define( 'MYWP_NAME' , 'My WP' );
    45     define( 'MYWP_VERSION' , '1.21.0' );
     45    define( 'MYWP_VERSION' , '1.21.1' );
    4646    define( 'MYWP_PLUGIN_FILE' , __FILE__ );
    4747    define( 'MYWP_PLUGIN_BASENAME' , plugin_basename( MYWP_PLUGIN_FILE ) );
  • my-wp/trunk/readme.txt

    r2890935 r2909963  
    44Requires at least: 4.7
    55Tested up to: 6.2
    6 Stable tag: 1.21.0
     6Stable tag: 1.21.1
    77License: GPLv3
    88License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    4646
    4747== Changelog ==
     48
     49= 1.21.1 2023-05-09 =
     50* Fixed: Misalignment of admin sidebar menu on mobile.
     51* Fixed: Hidden avatar icon on Site Editor.
     52* Fixed: Some security update(XSS vulnerability).
    4853
    4954= 1.21.0 2023-03-31 =
  • my-wp/trunk/setting/class.setting.menu.php

    r2547822 r2909963  
    132132  public static function set_current_menu_id( $setting_menu_id = false ) {
    133133
    134     $setting_menu_id = strip_tags( $setting_menu_id );
     134    $setting_menu_id = esc_attr( strip_tags( $setting_menu_id ) );
    135135
    136136    self::$current_menu_id = $setting_menu_id;
  • my-wp/trunk/setting/class.setting.post-type.php

    r2733956 r2909963  
    7373  public static function set_current_post_type_id( $post_type = false ) {
    7474
     75    $post_type = esc_attr( strip_tags( $post_type ) );
     76
     77    self::$current_post_type_id = $post_type;
     78
     79    self::set_current_post_type( $post_type );
     80
     81  }
     82
     83  public static function get_current_post_type_id() {
     84
     85    return self::$current_post_type_id;
     86
     87  }
     88
     89  private static function set_current_post_type( $post_type = false ) {
     90
     91    if( empty( $post_type ) ) {
     92
     93      $called_text = sprintf( '%s::%s( %s )' , __CLASS__ , __FUNCTION__ , '$post_type' );
     94
     95      MywpHelper::error_require_message( '$post_type' , $called_text );
     96
     97      return false;
     98
     99    }
     100
     101    $post_type_object = self::get_setting_post_type( $post_type );
     102
     103    if( empty( $post_type_object ) ) {
     104
     105      return false;
     106
     107    }
     108
     109    self::$current_post_type = $post_type_object;
     110
     111  }
     112
     113  public static function get_current_post_type() {
     114
     115    return self::$current_post_type;
     116
     117  }
     118
     119  public static function set_current_post_type_to_default() {
     120
     121    $post_types = self::get_setting_post_types();
     122
     123    if( empty( $post_types ) ) {
     124
     125      $called_text = sprintf( '%s::%s()' , __CLASS__ , __FUNCTION__ , '$post_types' );
     126
     127      MywpHelper::error_require_message( '$post_types' , $called_text );
     128
     129      return false;
     130
     131    }
     132
     133    $current_post_type_id = false;
     134
     135    foreach( $post_types as $post_type ) {
     136
     137      $current_post_type_id = $post_type->name;
     138
     139      break;
     140
     141    }
     142
     143    if( empty( $current_post_type_id ) ) {
     144
     145      return false;
     146
     147    }
     148
     149    self::set_current_post_type_id( $current_post_type_id );
     150
     151  }
     152
     153  public static function get_latest_post( $post_type = false ) {
     154
     155    if( empty( $post_type ) ) {
     156
     157      $called_text = sprintf( '%s::%s( %s )' , __CLASS__ , __FUNCTION__ , '$post_type' );
     158
     159      MywpHelper::error_require_message( '$post_type' , $called_text );
     160
     161      return false;
     162
     163    }
     164
    75165    $post_type = strip_tags( $post_type );
    76166
    77     self::$current_post_type_id = $post_type;
    78 
    79     self::set_current_post_type( $post_type );
    80 
    81   }
    82 
    83   public static function get_current_post_type_id() {
    84 
    85     return self::$current_post_type_id;
    86 
    87   }
    88 
    89   private static function set_current_post_type( $post_type = false ) {
    90 
    91     if( empty( $post_type ) ) {
    92 
    93       $called_text = sprintf( '%s::%s( %s )' , __CLASS__ , __FUNCTION__ , '$post_type' );
    94 
    95       MywpHelper::error_require_message( '$post_type' , $called_text );
    96 
    97       return false;
    98 
    99     }
    100 
    101167    $post_type_object = self::get_setting_post_type( $post_type );
    102168
     
    107173    }
    108174
    109     self::$current_post_type = $post_type_object;
    110 
    111   }
    112 
    113   public static function get_current_post_type() {
    114 
    115     return self::$current_post_type;
    116 
    117   }
    118 
    119   public static function set_current_post_type_to_default() {
    120 
    121     $post_types = self::get_setting_post_types();
    122 
    123     if( empty( $post_types ) ) {
    124 
    125       $called_text = sprintf( '%s::%s()' , __CLASS__ , __FUNCTION__ , '$post_types' );
    126 
    127       MywpHelper::error_require_message( '$post_types' , $called_text );
    128 
    129       return false;
    130 
    131     }
    132 
    133     $current_post_type_id = false;
    134 
    135     foreach( $post_types as $post_type ) {
    136 
    137       $current_post_type_id = $post_type->name;
    138 
    139       break;
    140 
    141     }
    142 
    143     if( empty( $current_post_type_id ) ) {
    144 
    145       return false;
    146 
    147     }
    148 
    149     self::set_current_post_type_id( $current_post_type_id );
    150 
    151   }
    152 
    153   public static function get_latest_post( $post_type = false ) {
    154 
    155     if( empty( $post_type ) ) {
    156 
    157       $called_text = sprintf( '%s::%s( %s )' , __CLASS__ , __FUNCTION__ , '$post_type' );
    158 
    159       MywpHelper::error_require_message( '$post_type' , $called_text );
    160 
    161       return false;
    162 
    163     }
     175    $args = array( 'post_type' => $post_type , 'order' => 'DESC' , 'orderby' => 'post_date' , 'numberposts' => 1 );
     176
     177    $args = apply_filters( "mywp_setting_get_latest_post_args_{$post_type}" , $args );
     178
     179    $posts = get_posts( $args );
     180
     181    if( ! empty( $posts ) ) {
     182
     183      $key = key( $posts );
     184
     185      return $posts[ $key ];
     186
     187    } else {
     188
     189      return false;
     190
     191    }
     192
     193  }
     194
     195  public static function get_one_post_link_edit( $post_type = false ) {
     196
     197    $post = self::get_latest_post( $post_type );
     198
     199    if( ! empty( $post ) ) {
     200
     201      return add_query_arg( array( 'post' => $post->ID , 'action' => 'edit' ) , admin_url( 'post.php' ) );
     202
     203    } else {
     204
     205      return add_query_arg( array( 'post_type' => $post_type ) , admin_url( 'post-new.php' ) );
     206
     207    }
     208
     209  }
     210
     211  public static function get_list_link( $post_type = false ) {
    164212
    165213    $post_type = strip_tags( $post_type );
    166214
    167     $post_type_object = self::get_setting_post_type( $post_type );
    168 
    169     if( empty( $post_type_object ) ) {
    170 
    171       return false;
    172 
    173     }
    174 
    175     $args = array( 'post_type' => $post_type , 'order' => 'DESC' , 'orderby' => 'post_date' , 'numberposts' => 1 );
    176 
    177     $args = apply_filters( "mywp_setting_get_latest_post_args_{$post_type}" , $args );
    178 
    179     $posts = get_posts( $args );
    180 
    181     if( ! empty( $posts ) ) {
    182 
    183       $key = key( $posts );
    184 
    185       return $posts[ $key ];
    186 
    187     } else {
    188 
    189       return false;
    190 
    191     }
    192 
    193   }
    194 
    195   public static function get_one_post_link_edit( $post_type = false ) {
    196 
    197     $post = self::get_latest_post( $post_type );
    198 
    199     if( ! empty( $post ) ) {
    200 
    201       return add_query_arg( array( 'post' => $post->ID , 'action' => 'edit' ) , admin_url( 'post.php' ) );
    202 
    203     } else {
    204 
    205       return add_query_arg( array( 'post_type' => $post_type ) , admin_url( 'post-new.php' ) );
    206 
    207     }
    208 
    209   }
    210 
    211   public static function get_list_link( $post_type = false ) {
    212 
    213     $post_type = strip_tags( $post_type );
    214 
    215215    return add_query_arg( array( 'post_type' => $post_type ) , admin_url( 'edit.php' ) );
    216216
  • my-wp/trunk/setting/class.setting.screen.php

    r2547822 r2909963  
    7575  public static function set_current_screen_id( $setting_screen_id = false ) {
    7676
    77     $setting_screen_id = strip_tags( $setting_screen_id );
     77    $setting_screen_id = esc_attr( strip_tags( $setting_screen_id ) );
    7878
    7979    self::$current_screen_id = $setting_screen_id;
  • my-wp/trunk/setting/class.setting.taxonomy.php

    r2733956 r2909963  
    6767  public static function set_current_taxonomy_id( $taxonomy = false ) {
    6868
     69    $taxonomy = esc_attr( strip_tags( $taxonomy ) );
     70
     71    self::$current_taxonomy_id = $taxonomy;
     72
     73    self::set_current_taxonomy( $taxonomy );
     74
     75  }
     76
     77  public static function get_current_taxonomy_id() {
     78
     79    return self::$current_taxonomy_id;
     80
     81  }
     82
     83  private static function set_current_taxonomy( $taxonomy = false ) {
     84
     85    if( empty( $taxonomy ) ) {
     86
     87      $called_text = sprintf( '%s::%s( %s )' , __CLASS__ , __FUNCTION__ , '$taxonomy' );
     88
     89      MywpHelper::error_require_message( '$taxonomy' , $called_text );
     90
     91      return false;
     92
     93    }
     94
     95    $taxonomy_object = self::get_setting_taxonomy( $taxonomy );
     96
     97    if( empty( $taxonomy_object ) ) {
     98
     99      return false;
     100
     101    }
     102
     103    self::$current_taxonomy = $taxonomy_object;
     104
     105  }
     106
     107  public static function get_current_taxonomy() {
     108
     109    return self::$current_taxonomy;
     110
     111  }
     112
     113  public static function set_current_taxonomy_to_default() {
     114
     115    $taxonomies = self::get_setting_taxonomies();
     116
     117    if( empty( $taxonomies ) ) {
     118
     119      $called_text = sprintf( '%s::%s()' , __CLASS__ , __FUNCTION__ , '$taxonomies' );
     120
     121      MywpHelper::error_require_message( '$taxonomies' , $called_text );
     122
     123      return false;
     124
     125    }
     126
     127    $current_taxonomy_id = false;
     128
     129    foreach( $taxonomies as $taxonomy ) {
     130
     131      $current_taxonomy_id = $taxonomy->name;
     132
     133      break;
     134
     135    }
     136
     137    if( empty( $current_taxonomy_id ) ) {
     138
     139      return false;
     140
     141    }
     142
     143    self::set_current_taxonomy_id( $current_taxonomy_id );
     144
     145  }
     146
     147  public static function get_one_term( $taxonomy = false ) {
     148
     149    if( empty( $taxonomy ) ) {
     150
     151      $called_text = sprintf( '%s::%s( %s )' , __CLASS__ , __FUNCTION__ , '$taxonomy' );
     152
     153      MywpHelper::error_require_message( '$taxonomy' , $called_text );
     154
     155      return false;
     156
     157    }
     158
    69159    $taxonomy = strip_tags( $taxonomy );
    70160
    71     self::$current_taxonomy_id = $taxonomy;
    72 
    73     self::set_current_taxonomy( $taxonomy );
    74 
    75   }
    76 
    77   public static function get_current_taxonomy_id() {
    78 
    79     return self::$current_taxonomy_id;
    80 
    81   }
    82 
    83   private static function set_current_taxonomy( $taxonomy = false ) {
    84 
    85     if( empty( $taxonomy ) ) {
    86 
    87       $called_text = sprintf( '%s::%s( %s )' , __CLASS__ , __FUNCTION__ , '$taxonomy' );
    88 
    89       MywpHelper::error_require_message( '$taxonomy' , $called_text );
    90 
    91       return false;
    92 
    93     }
    94 
    95161    $taxonomy_object = self::get_setting_taxonomy( $taxonomy );
    96162
     
    101167    }
    102168
    103     self::$current_taxonomy = $taxonomy_object;
    104 
    105   }
    106 
    107   public static function get_current_taxonomy() {
    108 
    109     return self::$current_taxonomy;
    110 
    111   }
    112 
    113   public static function set_current_taxonomy_to_default() {
    114 
    115     $taxonomies = self::get_setting_taxonomies();
    116 
    117     if( empty( $taxonomies ) ) {
    118 
    119       $called_text = sprintf( '%s::%s()' , __CLASS__ , __FUNCTION__ , '$taxonomies' );
    120 
    121       MywpHelper::error_require_message( '$taxonomies' , $called_text );
    122 
    123       return false;
    124 
    125     }
    126 
    127     $current_taxonomy_id = false;
    128 
    129     foreach( $taxonomies as $taxonomy ) {
    130 
    131       $current_taxonomy_id = $taxonomy->name;
    132 
    133       break;
    134 
    135     }
    136 
    137     if( empty( $current_taxonomy_id ) ) {
    138 
    139       return false;
    140 
    141     }
    142 
    143     self::set_current_taxonomy_id( $current_taxonomy_id );
    144 
    145   }
    146 
    147   public static function get_one_term( $taxonomy = false ) {
    148 
    149     if( empty( $taxonomy ) ) {
    150 
    151       $called_text = sprintf( '%s::%s( %s )' , __CLASS__ , __FUNCTION__ , '$taxonomy' );
    152 
    153       MywpHelper::error_require_message( '$taxonomy' , $called_text );
    154 
    155       return false;
    156 
    157     }
     169    $args = array( 'taxonomy' => $taxonomy , 'order' => 'DESC' , 'orderby' => 'term_id' );
     170
     171    $args = apply_filters( "mywp_setting_get_one_term_args_{$taxonomy}" , $args );
     172
     173    $terms = get_terms( $args );
     174
     175    if( ! empty( $terms ) ) {
     176
     177      $key = key( $terms );
     178
     179      return $terms[ $key ];
     180
     181    } else {
     182
     183      return false;
     184
     185    }
     186
     187  }
     188
     189  public static function get_one_term_archive_link( $taxonomy = false ) {
     190
     191    $term = self::get_one_term( $taxonomy );
     192
     193    if( ! empty( $term ) ) {
     194
     195      return get_term_link( $term );
     196
     197    }
     198
     199  }
     200
     201  public static function get_list_link( $taxonomy = false ) {
    158202
    159203    $taxonomy = strip_tags( $taxonomy );
    160204
    161     $taxonomy_object = self::get_setting_taxonomy( $taxonomy );
    162 
    163     if( empty( $taxonomy_object ) ) {
    164 
    165       return false;
    166 
    167     }
    168 
    169     $args = array( 'taxonomy' => $taxonomy , 'order' => 'DESC' , 'orderby' => 'term_id' );
    170 
    171     $args = apply_filters( "mywp_setting_get_one_term_args_{$taxonomy}" , $args );
    172 
    173     $terms = get_terms( $args );
    174 
    175     if( ! empty( $terms ) ) {
    176 
    177       $key = key( $terms );
    178 
    179       return $terms[ $key ];
    180 
    181     } else {
    182 
    183       return false;
    184 
    185     }
    186 
    187   }
    188 
    189   public static function get_one_term_archive_link( $taxonomy = false ) {
    190 
    191     $term = self::get_one_term( $taxonomy );
    192 
    193     if( ! empty( $term ) ) {
    194 
    195       return get_term_link( $term );
    196 
    197     }
    198 
    199   }
    200 
    201   public static function get_list_link( $taxonomy = false ) {
    202 
    203     $taxonomy = strip_tags( $taxonomy );
    204 
    205205    return add_query_arg( array( 'taxonomy' => $taxonomy ) , admin_url( 'edit-tags.php' ) );
    206206
Note: See TracChangeset for help on using the changeset viewer.