| @@ -29,8 +29,9 @@ | ||
| 29 | 29 | public $tb_lp_question_answermeta; |
| 30 | 30 | public $tb_lp_upgrade_db; |
| 31 | 31 | public $tb_lp_sessions; |
| 32 | 32 | public $tb_lp_files; |
| 33 | + public $tb_lp_webhooks; | |
| 33 | 34 | public $tb_thim_cache; |
| 34 | 35 | private $collate = ''; |
| 35 | 36 | public $max_index_length = '191'; |
| 36 | 37 | |
| @@ -62,8 +63,9 @@ | ||
| 62 | 63 | $this->tb_lp_question_answermeta = $prefix . 'learnpress_question_answermeta'; |
| 63 | 64 | $this->tb_lp_upgrade_db = $prefix . 'learnpress_upgrade_db'; |
| 64 | 65 | $this->tb_lp_sessions = $prefix . 'learnpress_sessions'; |
| 65 | 66 | $this->tb_lp_files = $prefix . 'learnpress_files'; |
| 67 | + $this->tb_lp_webhooks = $prefix . 'learnpress_webhooks'; | |
| 66 | 68 | $this->tb_thim_cache = $prefix . 'thim_cache'; |
| 67 | 69 | $this->wpdb->hide_errors(); |
| 68 | 70 | $this->set_collate(); |
| 69 | 71 | } |
| @@ -196,9 +198,9 @@ | ||
| 196 | 198 | * @throws Exception |
| 197 | 199 | */ |
| 198 | 200 | public function add_col_table( string $name_table, string $name_col, string $type, string $after_col = '' ) { |
| 199 | 201 | if ( ! current_user_can( ADMIN_ROLE ) ) { |
| 200 | - throw new Exception( 'You don\'t have permission' ); | |
| 202 | + return false; | |
| 201 | 203 | } |
| 202 | 204 | |
| 203 | 205 | $query_add = ''; |
| 204 | 206 | |
| @@ -787,9 +789,8 @@ | ||
| 787 | 789 | $data = $args['data'] ?? []; |
| 788 | 790 | $filter = $args['filter'] ?? null; |
| 789 | 791 | $table_name = $args['table_name'] ?? ''; |
| 790 | 792 | $key_auto_increment = $args['key_auto_increment'] ?? ''; |
| 791 | - $key_auto_increment = sanitize_key( $key_auto_increment ); | |
| 792 | 793 | |
| 793 | 794 | if ( empty( $data ) || ! is_array( $data ) ) { |
| 794 | 795 | throw new Exception( __( 'Data must be an array!', 'learnpress' ) . ' | ' . __FUNCTION__ ); |
| 795 | 796 | } |
| @@ -834,9 +835,9 @@ | ||
| 834 | 835 | * @return bool |
| 835 | 836 | * |
| 836 | 837 | * @throws Exception |
| 837 | 838 | * @since 4.2.9 |
| 838 | - * @version 1.0.1 | |
| 839 | + * @version 1.0.2 | |
| 839 | 840 | */ |
| 840 | 841 | public function update_data( array $args ): bool { |
| 841 | 842 | $data = $args['data'] ?? []; |
| 842 | 843 | $filter = $args['filter'] ?? null; |
| @@ -841,9 +842,8 @@ | ||
| 841 | 842 | $data = $args['data'] ?? []; |
| 842 | 843 | $filter = $args['filter'] ?? null; |
| 843 | 844 | $table_name = $args['table_name'] ?? ''; |
| 844 | 845 | $where_key = $args['where_key'] ?? ''; |
| 845 | - $where_key = sanitize_key( $where_key ); | |
| 846 | 846 | |
| 847 | 847 | /*if ( ! $filter instanceof FilterBase ) { |
| 848 | 848 | throw new Exception( __( 'Invalid filter!', 'learnpress' ) . ' | ' . __FUNCTION__ ); |
| 849 | 849 | }*/ |