Plugin Directory

Changeset 3413539


Ignore:
Timestamp:
12/07/2025 02:17:12 PM (3 months ago)
Author:
awesomefootnotes
Message:

Adding the first version of my plugin

Location:
0-day-analytics
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • 0-day-analytics/tags/4.3.1/classes/vendor/controllers/class-endpoints.php

    r3393178 r3413539  
    4848        public static $endpoints = array(
    4949            self::class => array(
    50                 'live'             => array(
     50                'live'                 => array(
    5151                    'class'     => Logs_List::class,
    5252                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
     
    6565                    ),
    6666                ),
    67                 'severity'         => array(
     67                'severity'             => array(
    6868                    'class'     => Logs_List::class,
    6969                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
     
    9494                    ),
    9595                ),
    96                 'single_severity'  => array(
     96                'single_severity'      => array(
    9797                    'class'     => Logs_List::class,
    9898                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
     
    118118                    ),
    119119                ),
    120                 'requests'         => array(
     120                'requests'             => array(
    121121                    'class'     => Requests_List::class,
    122122                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
     
    147147                    ),
    148148                ),
    149                 'cron_run'         => array(
     149                'cron_run'             => array(
    150150                    'class'     => Crons_Helper::class,
    151151                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
     
    171171                    ),
    172172                ),
    173                 'drop_table'       => array(
     173                'drop_table'           => array(
    174174                    'class'     => Common_Table::class,
    175175                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
     
    196196                    ),
    197197                ),
    198                 'truncate_table'   => array(
     198                'truncate_table'       => array(
    199199                    'class'     => Common_Table::class,
    200200                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
     
    221221                    ),
    222222                ),
    223                 'get_table_record' => array(
     223                'get_table_record'     => array(
    224224                    'class'     => Common_Table::class,
    225225                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
     
    252252                    ),
    253253                ),
    254                 'get_fatals_record' => array(
     254                'get_fatals_record'    => array(
    255255                    'class'     => Common_Table::class,
    256256                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
     
    308308                    ),
    309309                ),
    310                 'mail_body'        => array(
     310                'mail_body'            => array(
    311311                    'class'     => WP_Mail_List::class,
    312312                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
  • 0-day-analytics/tags/4.3.1/classes/vendor/lists/views/class-snippets-view.php

    r3413453 r3413539  
    103103            $tags       = isset( $_POST['snippet_tags'] ) ? Snippet_Entity::sanitize_tags( $_POST['snippet_tags'] ) : '';
    104104            $code       = isset( $_POST['snippet_code'] ) ? \wp_unslash( $_POST['snippet_code'] ) : '';
    105             $scope     = isset( $_POST['snippet_scope'] ) ? \sanitize_key( \wp_unslash( $_POST['snippet_scope'] ) ) : Snippet_Entity::SCOPE_EVERYWHERE;
    106             $scopes    = array_keys( Snippet_Entity::get_execution_scopes() );
     105            $scope      = isset( $_POST['snippet_scope'] ) ? \sanitize_key( \wp_unslash( $_POST['snippet_scope'] ) ) : Snippet_Entity::SCOPE_EVERYWHERE;
     106            $scopes     = array_keys( Snippet_Entity::get_execution_scopes() );
    107107            if ( ! in_array( $scope, $scopes, true ) ) {
    108108                $scope = Snippet_Entity::SCOPE_EVERYWHERE;
     
    172172            );
    173173
     174            if ( 0 === $snippet_id ) {
     175                unset( $data['id'] );
     176            }
     177
    174178            Snippet_Entity::insert( $data );
    175179
     
    398402                $scope_value = Snippet_Entity::SCOPE_EVERYWHERE;
    399403            }
    400             $hook_value       = $snippet['execution_hook'] ?? 'init';
    401             $priority_value   = (int) ( $snippet['hook_priority'] ?? 10 );
     404            $hook_value     = $snippet['execution_hook'] ?? 'init';
     405            $priority_value = (int) ( $snippet['hook_priority'] ?? 10 );
    402406            if ( $priority_value <= 0 ) {
    403407                $priority_value = 10;
    404408            }
    405             $shortcode_value   = $snippet['shortcode_tag'] ?? '';
    406             $conditions_value  = $snippet['run_conditions'] ?? '';
     409            $shortcode_value    = $snippet['shortcode_tag'] ?? '';
     410            $conditions_value   = $snippet['run_conditions'] ?? '';
    407411            $conditions_preview = '' !== $conditions_value ? Snippet_Condition_Evaluator::get_normalized_rules( $conditions_value ) : array();
    408             $execute_url     = '';
     412            $execute_url        = '';
    409413            if ( $is_edit && $snippet_id > 0 && 'php' === ( $snippet['type'] ?? 'php' ) ) {
    410414                $execute_url = \wp_nonce_url(
     
    555559                                                        $operator = ( 'neq' === ( $rule['operator'] ?? 'eq' ) ) ? '!=' : '=';
    556560                                                        $values   = array();
    557                                                         foreach ( (array) ( $rule['values'] ?? array() ) as $preview_value ) {
    558                                                             $values[] = \sanitize_text_field( (string) $preview_value );
    559                                                         }
     561                                                    foreach ( (array) ( $rule['values'] ?? array() ) as $preview_value ) {
     562                                                        $values[] = \sanitize_text_field( (string) $preview_value );
     563                                                    }
    560564                                                    ?>
    561565                                                    <li>
     
    697701        private static function print_execution_notice( array $data ): void {
    698702            static $share_script_output = false;
    699             $status_class = ( 'success' === $data['status'] ) ? 'notice-success' : 'notice-error';
     703            $status_class               = ( 'success' === $data['status'] ) ? 'notice-success' : 'notice-error';
    700704            ?>
    701705            <style>
     
    723727                <?php endif; ?>
    724728            </div>
    725             <?php if ( ! $share_script_output ) : $share_script_output = true; ?>
     729            <?php
     730            if ( ! $share_script_output ) :
     731                $share_script_output = true;
     732                ?>
    726733                <script>
    727734                    (function($){
  • 0-day-analytics/trunk/classes/vendor/controllers/class-endpoints.php

    r3393178 r3413539  
    4848        public static $endpoints = array(
    4949            self::class => array(
    50                 'live'             => array(
     50                'live'                 => array(
    5151                    'class'     => Logs_List::class,
    5252                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
     
    6565                    ),
    6666                ),
    67                 'severity'         => array(
     67                'severity'             => array(
    6868                    'class'     => Logs_List::class,
    6969                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
     
    9494                    ),
    9595                ),
    96                 'single_severity'  => array(
     96                'single_severity'      => array(
    9797                    'class'     => Logs_List::class,
    9898                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
     
    118118                    ),
    119119                ),
    120                 'requests'         => array(
     120                'requests'             => array(
    121121                    'class'     => Requests_List::class,
    122122                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
     
    147147                    ),
    148148                ),
    149                 'cron_run'         => array(
     149                'cron_run'             => array(
    150150                    'class'     => Crons_Helper::class,
    151151                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
     
    171171                    ),
    172172                ),
    173                 'drop_table'       => array(
     173                'drop_table'           => array(
    174174                    'class'     => Common_Table::class,
    175175                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
     
    196196                    ),
    197197                ),
    198                 'truncate_table'   => array(
     198                'truncate_table'       => array(
    199199                    'class'     => Common_Table::class,
    200200                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
     
    221221                    ),
    222222                ),
    223                 'get_table_record' => array(
     223                'get_table_record'     => array(
    224224                    'class'     => Common_Table::class,
    225225                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
     
    252252                    ),
    253253                ),
    254                 'get_fatals_record' => array(
     254                'get_fatals_record'    => array(
    255255                    'class'     => Common_Table::class,
    256256                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
     
    308308                    ),
    309309                ),
    310                 'mail_body'        => array(
     310                'mail_body'            => array(
    311311                    'class'     => WP_Mail_List::class,
    312312                    'namespace' => self::ENDPOINT_ROOT_NAME . '/v1',
  • 0-day-analytics/trunk/classes/vendor/lists/views/class-snippets-view.php

    r3413453 r3413539  
    103103            $tags       = isset( $_POST['snippet_tags'] ) ? Snippet_Entity::sanitize_tags( $_POST['snippet_tags'] ) : '';
    104104            $code       = isset( $_POST['snippet_code'] ) ? \wp_unslash( $_POST['snippet_code'] ) : '';
    105             $scope     = isset( $_POST['snippet_scope'] ) ? \sanitize_key( \wp_unslash( $_POST['snippet_scope'] ) ) : Snippet_Entity::SCOPE_EVERYWHERE;
    106             $scopes    = array_keys( Snippet_Entity::get_execution_scopes() );
     105            $scope      = isset( $_POST['snippet_scope'] ) ? \sanitize_key( \wp_unslash( $_POST['snippet_scope'] ) ) : Snippet_Entity::SCOPE_EVERYWHERE;
     106            $scopes     = array_keys( Snippet_Entity::get_execution_scopes() );
    107107            if ( ! in_array( $scope, $scopes, true ) ) {
    108108                $scope = Snippet_Entity::SCOPE_EVERYWHERE;
     
    172172            );
    173173
     174            if ( 0 === $snippet_id ) {
     175                unset( $data['id'] );
     176            }
     177
    174178            Snippet_Entity::insert( $data );
    175179
     
    398402                $scope_value = Snippet_Entity::SCOPE_EVERYWHERE;
    399403            }
    400             $hook_value       = $snippet['execution_hook'] ?? 'init';
    401             $priority_value   = (int) ( $snippet['hook_priority'] ?? 10 );
     404            $hook_value     = $snippet['execution_hook'] ?? 'init';
     405            $priority_value = (int) ( $snippet['hook_priority'] ?? 10 );
    402406            if ( $priority_value <= 0 ) {
    403407                $priority_value = 10;
    404408            }
    405             $shortcode_value   = $snippet['shortcode_tag'] ?? '';
    406             $conditions_value  = $snippet['run_conditions'] ?? '';
     409            $shortcode_value    = $snippet['shortcode_tag'] ?? '';
     410            $conditions_value   = $snippet['run_conditions'] ?? '';
    407411            $conditions_preview = '' !== $conditions_value ? Snippet_Condition_Evaluator::get_normalized_rules( $conditions_value ) : array();
    408             $execute_url     = '';
     412            $execute_url        = '';
    409413            if ( $is_edit && $snippet_id > 0 && 'php' === ( $snippet['type'] ?? 'php' ) ) {
    410414                $execute_url = \wp_nonce_url(
     
    555559                                                        $operator = ( 'neq' === ( $rule['operator'] ?? 'eq' ) ) ? '!=' : '=';
    556560                                                        $values   = array();
    557                                                         foreach ( (array) ( $rule['values'] ?? array() ) as $preview_value ) {
    558                                                             $values[] = \sanitize_text_field( (string) $preview_value );
    559                                                         }
     561                                                    foreach ( (array) ( $rule['values'] ?? array() ) as $preview_value ) {
     562                                                        $values[] = \sanitize_text_field( (string) $preview_value );
     563                                                    }
    560564                                                    ?>
    561565                                                    <li>
     
    697701        private static function print_execution_notice( array $data ): void {
    698702            static $share_script_output = false;
    699             $status_class = ( 'success' === $data['status'] ) ? 'notice-success' : 'notice-error';
     703            $status_class               = ( 'success' === $data['status'] ) ? 'notice-success' : 'notice-error';
    700704            ?>
    701705            <style>
     
    723727                <?php endif; ?>
    724728            </div>
    725             <?php if ( ! $share_script_output ) : $share_script_output = true; ?>
     729            <?php
     730            if ( ! $share_script_output ) :
     731                $share_script_output = true;
     732                ?>
    726733                <script>
    727734                    (function($){
Note: See TracChangeset for help on using the changeset viewer.