diff --git a/classes/Visualizer/Gutenberg/Block.php b/classes/Visualizer/Gutenberg/Block.php index 72e129b04..38b479ee9 100644 --- a/classes/Visualizer/Gutenberg/Block.php +++ b/classes/Visualizer/Gutenberg/Block.php @@ -186,8 +186,7 @@ public function gutenberg_block_callback( $atts ) { return ''; } - // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison - if ( $atts['lazy'] == -1 || $atts['lazy'] == false ) { + if ( $atts['lazy'] === '-1' || $atts['lazy'] === false ) { $atts['lazy'] = 'no'; } @@ -472,11 +471,12 @@ public function get_visualizer_data( $post ) { $permissions = get_post_meta( $post_id, Visualizer_Pro::CF_PERMISSIONS, true ); if ( empty( $permissions ) ) { - $permissions = array( 'permissions' => array( + $permissions = array( + 'permissions' => array( 'read' => 'all', 'edit' => 'roles', 'edit-specific' => array( 'administrator' ), - ), + ), ); } @@ -824,7 +824,7 @@ public function get_permission_data( $data ) { foreach ( $users as $user ) { $options[ $i ]['value'] = $user->ID; $options[ $i ]['label'] = $user->display_name; - $i++; + ++$i; } } break; @@ -838,7 +838,7 @@ public function get_permission_data( $data ) { foreach ( get_editable_roles() as $name => $info ) { $options[ $i ]['value'] = $name; $options[ $i ]['label'] = $name; - $i++; + ++$i; } } break; diff --git a/classes/Visualizer/Module.php b/classes/Visualizer/Module.php index e869aceb6..8a2a7311c 100644 --- a/classes/Visualizer/Module.php +++ b/classes/Visualizer/Module.php @@ -68,8 +68,7 @@ public function __construct( Visualizer_Plugin $plugin ) { $this->_addFilter( Visualizer_Plugin::FILTER_HANDLE_REVISIONS, 'handleExistingRevisions', 10, 2 ); $this->_addFilter( Visualizer_Plugin::FILTER_GET_CHART_DATA_AS, 'getDataAs', 10, 3 ); $this->_addAction( 'pre_get_posts', 'PreGetPosts' ); - register_shutdown_function( array($this, 'onShutdown') ); - + register_shutdown_function( array( $this, 'onShutdown' ) ); } /** @@ -114,16 +113,16 @@ protected function _addAction( $tag, $method, $methodClass = null, $priority = 1 * @param string $tag The name of the AJAX action to which the $method is hooked. * @param string $method Optional. The name of the method to be called. If the name of the method is not provided, tag name will be used as method name. * @param bool $methodClass The root of the method. - * @param boolean $private Optional. Determines if we should register hook for logged in users. - * @param boolean $public Optional. Determines if we should register hook for not logged in users. + * @param boolean $logged_in Optional. Determines if we should register hook for logged in users. + * @param boolean $logged_out Optional. Determines if we should register hook for not logged in users. * @return Visualizer_Module */ - protected function _addAjaxAction( $tag, $method = '', $methodClass = null, $private = true, $public = false ) { - if ( $private ) { + protected function _addAjaxAction( $tag, $method = '', $methodClass = null, $logged_in = true, $logged_out = false ) { + if ( $logged_in ) { $this->_addAction( 'wp_ajax_' . $tag, $method, $methodClass ); } - if ( $public ) { + if ( $logged_out ) { $this->_addAction( 'wp_ajax_nopriv_' . $tag, $method, $methodClass ); } @@ -169,7 +168,7 @@ protected function _addShortcode( $tag, $method ) { * * @since 3.2.0 */ - public function getDataAs( $final, $chart_id, $type ) { + public function getDataAs( $data, $chart_id, $type ) { return $this->_getDataAs( $chart_id, $type ); } @@ -290,8 +289,8 @@ private function _getCSV( $rows, $filename, $enclose ) { } rewind( $fp ); $csv = ''; - // phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition - while ( ( $array = fgetcsv( $fp ) ) !== false ) { + $array = fgetcsv( $fp ); + while ( $array !== false ) { if ( strlen( $csv ) > 0 ) { $csv .= PHP_EOL; } @@ -307,7 +306,8 @@ private function _getCSV( $rows, $filename, $enclose ) { } $array = $temp_array; } - $csv .= implode( ',', $array ); + $csv .= implode( ',', $array ); + $array = fgetcsv( $fp ); } fclose( $fp ); @@ -333,7 +333,7 @@ private function _getExcel( $rows, $filename ) { unset( $rows[1] ); $rows = array_values( $rows ); $rows = array_map( - function( $r ) { + function ( $r ) { return array_map( 'strval', $r ); }, $rows @@ -405,7 +405,7 @@ private function _getHTML( $rows ) { foreach ( $rows as $row ) { // skip the data type row. if ( 1 === $index ) { - $index++; + ++$index; continue; } @@ -418,7 +418,7 @@ private function _getHTML( $rows ) { } } $table .= ''; - $index++; + ++$index; } $table .= ''; @@ -433,9 +433,9 @@ private function _getHTML( $rows ) { /** * Disable revisions temporarily for visualizer post type. */ - protected final function disableRevisionsTemporarily() { + final protected function disableRevisionsTemporarily() { add_filter( - 'wp_revisions_to_keep', function( $num, $post ) { + 'wp_revisions_to_keep', function ( $num, $post ) { if ( $post->post_type === Visualizer_Plugin::CPT_VISUALIZER ) { return 0; } @@ -449,7 +449,7 @@ protected final function disableRevisionsTemporarily() { * * @return bool If any revisions were found. */ - public final function undoRevisions( $chart_id, $restore = false ) { + final public function undoRevisions( $chart_id, $restore = false ) { do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'undoRevisions for %d with%s restore', $chart_id, ( $restore ? '' : 'out' ) ), 'debug', __FILE__, __LINE__ ); if ( get_post_type( $chart_id ) !== Visualizer_Plugin::CPT_VISUALIZER ) { return false; @@ -481,7 +481,7 @@ public final function undoRevisions( $chart_id, $restore = false ) { /** * If existing revisions exist for the chart, restore the earliest version and then create a new revision to initiate editing. */ - public final function handleExistingRevisions( $chart_id, $chart ) { + final public function handleExistingRevisions( $chart_id, $chart ) { do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'handleExistingRevisions for %d', $chart_id ), 'debug', __FILE__, __LINE__ ); if ( get_post_type( $chart_id ) !== Visualizer_Plugin::CPT_VISUALIZER ) { @@ -533,7 +533,7 @@ protected function get_user_customization_js() { } try { - require_once( ABSPATH . 'wp-admin/includes/file.php' ); + require_once ABSPATH . 'wp-admin/includes/file.php'; WP_Filesystem(); global $wp_filesystem; if ( ! is_a( $wp_filesystem, 'WP_Filesystem_Base' ) ) { @@ -558,8 +558,8 @@ protected function get_user_customization_js() { } if ( ! $wp_filesystem->exists( $dir ) ) { - // phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition.Found - if ( ( $done = $wp_filesystem->mkdir( $dir ) ) === false ) { + $done = $wp_filesystem->mkdir( $dir ); + if ( $done === false ) { do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Unable to create directory %s', $dir ), 'error', __FILE__, __LINE__ ); return $default; } @@ -567,9 +567,9 @@ protected function get_user_customization_js() { // if file does not exist, copy. if ( ! $wp_filesystem->exists( $file ) ) { - $src = str_replace( ABSPATH, $wp_filesystem->abspath(), VISUALIZER_ABSPATH . '/js/customization.js' ); - // phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition.Found - if ( ( $done = $wp_filesystem->copy( $src, $file ) ) === false ) { + $src = str_replace( ABSPATH, $wp_filesystem->abspath(), VISUALIZER_ABSPATH . '/js/customization.js' ); + $done = $wp_filesystem->copy( $src, $file ); + if ( $done === false ) { do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Unable to copy file %s to %s', $src, $file ), 'error', __FILE__, __LINE__ ); return $default; } @@ -591,7 +591,7 @@ protected function load_chart_type( $chart_id ) { if ( 'Visualizer_Render_Sidebar_Type_DataTable_DataTable' === $name ) { $name = 'Visualizer_Render_Sidebar_Type_DataTable_Tabular'; } - $class = new $name; + $class = new $name(); } if ( is_null( $class ) && Visualizer_Module::is_pro() ) { @@ -752,7 +752,7 @@ public static function can_show_feature( $feature ) { /** * Gets the features for the provided license type. */ - public static final function get_features_for_license( $plan ) { + final public static function get_features_for_license( $plan ) { $is_new_personal = apply_filters( 'visualizer_is_new_personal', false ); switch ( $plan ) { case 1: diff --git a/classes/Visualizer/Module/AMP.php b/classes/Visualizer/Module/AMP.php index b9b3a079a..9b5977140 100644 --- a/classes/Visualizer/Module/AMP.php +++ b/classes/Visualizer/Module/AMP.php @@ -100,5 +100,4 @@ public function get_chart( $chart, $data, $series, $settings ) { } return $output['csv']; } - } diff --git a/classes/Visualizer/Module/Admin.php b/classes/Visualizer/Module/Admin.php index 2c02da8d0..02a3f16db 100644 --- a/classes/Visualizer/Module/Admin.php +++ b/classes/Visualizer/Module/Admin.php @@ -96,7 +96,6 @@ public function __construct( Visualizer_Plugin $plugin ) { if ( defined( 'TI_E2E_TESTING' ) ) { $this->load_cypress_hooks(); } - } /** * Display review notice. @@ -104,7 +103,7 @@ public function __construct( Visualizer_Plugin $plugin ) { public function render_review_notice( $footer_text ) { $current_screen = get_current_screen(); - $visualizer_page_ids = ['toplevel_page_visualizer', 'visualizer_page_viz-support', 'visualizer_page_ti-about-visualizer' ]; + $visualizer_page_ids = array( 'toplevel_page_visualizer', 'visualizer_page_viz-support', 'visualizer_page_ti-about-visualizer' ); if ( ! empty( $current_screen ) && isset( $current_screen->id ) ) { foreach ( $visualizer_page_ids as $page_to_check ) { @@ -134,7 +133,7 @@ public function render_review_notice( $footer_text ) { private function load_cypress_hooks() { // all charts should load on the same page without pagination. add_filter( - 'visualizer_query_args', function( $args ) { + 'visualizer_query_args', function ( $args ) { $args['posts_per_page'] = 20; return $args; }, 10, 1 @@ -253,8 +252,7 @@ public function restoreRevision( $post_id, $revision_id ) { * @access public */ public function init() { - // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison - if ( current_user_can( 'edit_posts' ) && current_user_can( 'edit_pages' ) && 'true' == get_user_option( 'rich_editing' ) ) { + if ( current_user_can( 'edit_posts' ) && current_user_can( 'edit_pages' ) && 'true' === get_user_option( 'rich_editing' ) ) { $this->_addFilter( 'mce_external_languages', 'add_tinymce_lang', 10, 1 ); $this->_addFilter( 'mce_external_plugins', 'tinymce_plugin', 10, 1 ); $this->_addFilter( 'mce_buttons', 'register_mce_button', 10, 1 ); @@ -268,7 +266,7 @@ public function init() { * @since ? * @access friendly */ - function get_strings_for_block( $settings ) { + public function get_strings_for_block( $settings ) { $class = new Visualizer_Module_Language(); $strings = $class->get_strings(); $array = array( 'visualizer_tinymce_plugin' => json_encode( $strings ) ); @@ -797,7 +795,7 @@ public function handleGetProSubMenu() { /** * Adds the screen options for pagination. */ - function addScreenOptions() { + public function addScreenOptions() { $screen = get_current_screen(); // bail if it's some other page. @@ -816,7 +814,7 @@ function addScreenOptions() { /** * Returns the screen option for pagination. */ - function setScreenOptions( $status, $option, $value ) { + public function setScreenOptions( $status, $option, $value ) { if ( 'visualizer_library_per_page' === $option ) { return $value; } diff --git a/classes/Visualizer/Module/Chart.php b/classes/Visualizer/Module/Chart.php index e31133b1a..aaee18cc7 100644 --- a/classes/Visualizer/Module/Chart.php +++ b/classes/Visualizer/Module/Chart.php @@ -70,7 +70,6 @@ public function __construct( Visualizer_Plugin $plugin ) { $this->_addAjaxAction( Visualizer_Plugin::ACTION_SAVE_FILTER_QUERY, 'saveFilter' ); $this->_addFilter( 'visualizer_get_sidebar', 'getSidebar', 10, 2 ); - } /** @@ -539,7 +538,8 @@ public function renderChartPages() { if ( ! empty( $_POST ) ) { $_POST = map_deep( $_POST, 'wp_strip_all_tags' ); } - if ( ! $chart_id || ! ( $chart = get_post( $chart_id ) ) || $chart->post_type !== Visualizer_Plugin::CPT_VISUALIZER ) { + $chart = $chart_id ? get_post( $chart_id ) : null; + if ( ! $chart_id || ! $chart || $chart->post_type !== Visualizer_Plugin::CPT_VISUALIZER ) { if ( empty( $_GET['lang'] ) || empty( $_GET['parent_chart_id'] ) ) { $this->deleteOldCharts(); $default_type = isset( $_GET['type'] ) && ! empty( $_GET['type'] ) ? $_GET['type'] : 'line'; @@ -738,7 +738,7 @@ private function loadCodeEditorAssets( $chart_id ) { wp_register_script( 'visualizer-codemirror-closebrackets', '//codemirror.net/addon/edit/closebrackets.js', array( 'visualizer-codemirror-core' ), Visualizer_Plugin::VERSION ); wp_register_script( 'visualizer-codemirror-sql', '//codemirror.net/mode/sql/sql.js', array( 'visualizer-codemirror-core' ), Visualizer_Plugin::VERSION ); wp_register_script( 'visualizer-codemirror-sql-hint', '//codemirror.net/addon/hint/sql-hint.js', array( 'visualizer-codemirror-core' ), Visualizer_Plugin::VERSION ); - wp_register_script( 'visualizer-codemirror-hint', '//codemirror.net/addon/hint/show-hint.js', array( 'visualizer-codemirror-sql', 'visualizer-codemirror-sql-hint', 'visualizer-codemirror-placeholder', 'visualizer-codemirror-matchbrackets', 'visualizer-codemirror-closebrackets' ), Visualizer_Plugin::VERSION ); + wp_register_script( 'visualizer-codemirror-hint', '//codemirror.net/addon/hint/show-hint.js', array( 'visualizer-codemirror-sql', 'visualizer-codemirror-sql-hint', 'visualizer-codemirror-placeholder', 'visualizer-codemirror-matchbrackets', 'visualizer-codemirror-closebrackets' ), Visualizer_Plugin::VERSION ); wp_register_style( 'visualizer-codemirror-core', '//codemirror.net/lib/codemirror.css', array(), Visualizer_Plugin::VERSION ); wp_register_style( 'visualizer-codemirror-hint', '//codemirror.net/addon/hint/show-hint.css', array( 'visualizer-codemirror-core' ), Visualizer_Plugin::VERSION ); @@ -862,10 +862,8 @@ private function _handleDataAndSettingsPage() { array( 'ajax' => array( 'url' => admin_url( 'admin-ajax.php' ), - 'nonces' => array( - ), - 'actions' => array( - ), + 'nonces' => array(), + 'actions' => array(), ), ) ); @@ -1028,7 +1026,7 @@ private function handleCSVasString( $data, $editor_type ) { } $row = explode( ',', $row ); $row = array_map( - function( $r ) { + function ( $r ) { return '' === $r ? ' ' : $r; }, $row @@ -1079,7 +1077,7 @@ private function handleTabularData() { if ( empty( $type ) ) { $exclude[] = $index; } - $index++; + ++$index; } // when N headers are being renamed, the number of headers increases by N @@ -1156,9 +1154,10 @@ public function uploadData() { // check chart, if chart exists // do not use filter_input as it does not work for phpunit test cases, use filter_var instead $chart_id = isset( $_GET['chart'] ) ? filter_var( $_GET['chart'], FILTER_VALIDATE_INT ) : ''; + $chart = $chart_id ? get_post( $chart_id ) : null; if ( ! $chart_id || - ! ( $chart = get_post( $chart_id ) ) || + ! $chart || $chart->post_type !== Visualizer_Plugin::CPT_VISUALIZER || ! current_user_can( 'edit_post', $chart_id ) ) { @@ -1214,8 +1213,7 @@ public function uploadData() { if ( isset( $_POST['vz-import-time'] ) ) { apply_filters( 'visualizer_pro_chart_schedule', $chart_id, $remote_data, $_POST['vz-import-time'] ); } - // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison - } elseif ( isset( $_FILES['local_data'] ) && $_FILES['local_data']['error'] == 0 ) { + } elseif ( isset( $_FILES['local_data'] ) && $_FILES['local_data']['error'] === 0 ) { $source = new Visualizer_Source_Csv( $_FILES['local_data']['tmp_name'] ); } elseif ( isset( $_POST['chart_data'] ) && strlen( $_POST['chart_data'] ) > 0 ) { $source = $this->handleCSVasString( $_POST['chart_data'], $_POST['editor-type'] ); diff --git a/classes/Visualizer/Module/Frontend.php b/classes/Visualizer/Module/Frontend.php index c8cb044bc..1905165e6 100644 --- a/classes/Visualizer/Module/Frontend.php +++ b/classes/Visualizer/Module/Frontend.php @@ -87,7 +87,7 @@ public function __construct( Visualizer_Plugin $plugin ) { /** * Adds the async attribute to certain scripts. */ - function script_loader_tag( $tag, $handle, $src ) { + public function script_loader_tag( $tag, $handle, $src ) { if ( is_admin() ) { return $tag; } @@ -98,7 +98,7 @@ function script_loader_tag( $tag, $handle, $src ) { $tag = str_replace( ' src', ' async src', $tag ); break; } - }; + } // Async scripts. $scripts = array( 'dom-to-image' ); @@ -124,7 +124,7 @@ function script_loader_tag( $tag, $handle, $src ) { /** * Returns the language/locale. */ - function getLanguage( $dummy, $only_language ) { + public function getLanguage( $dummy, $only_language ) { return $this->get_language(); } @@ -132,7 +132,7 @@ function getLanguage( $dummy, $only_language ) { /** * Registers the endpoints */ - function endpoint_register() { + public function endpoint_register() { register_rest_route( 'visualizer/v' . VISUALIZER_REST_VERSION, '/action/(?P\d+)/(?P.+)/', @@ -142,7 +142,7 @@ function endpoint_register() { 'args' => array( 'chart' => array( 'required' => true, - 'sanitize_callback' => function( $param ) { + 'sanitize_callback' => function ( $param ) { return is_numeric( $param ) ? $param : null; }, ), @@ -342,8 +342,8 @@ public function renderChart( $atts ) { } // in case revisions exist. - // phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition.Found - if ( true === ( $revisions = $this->undoRevisions( $chart->ID, true ) ) ) { + $revisions = $this->undoRevisions( $chart->ID, true ); + if ( true === $revisions ) { $chart = get_post( $chart->ID ); } @@ -509,7 +509,7 @@ public function renderChart( $atts ) { ) ); } - $count++; + ++$count; } $prefix = 'C' . 'h' . 'a' . 'rt'; if ( $type === 'tabular' ) { diff --git a/classes/Visualizer/Module/Language.php b/classes/Visualizer/Module/Language.php index cfaafdac2..38239a644 100644 --- a/classes/Visualizer/Module/Language.php +++ b/classes/Visualizer/Module/Language.php @@ -19,7 +19,7 @@ */ if ( ! class_exists( '_WP_Editors' ) ) { - require( ABSPATH . WPINC . '/class-wp-editor.php' ); + require ABSPATH . WPINC . '/class-wp-editor.php'; } /** @@ -79,7 +79,6 @@ public function tinymce_translation() { public function get_strings() { return $this->strings; } - } $visualizerLangClass = new Visualizer_Module_Language(); diff --git a/classes/Visualizer/Module/Sources.php b/classes/Visualizer/Module/Sources.php index 8d93e2920..e058c3319 100644 --- a/classes/Visualizer/Module/Sources.php +++ b/classes/Visualizer/Module/Sources.php @@ -145,7 +145,7 @@ public function addProUpsell( $old, $feature = null ) { if ( in_array( $feature, $biz_features, true ) && Visualizer_Module::is_pro() ) { $msg = $plus_msg; } - if ( in_array( $feature, [ 'db-query', 'chart-permissions' ], true ) ) { + if ( in_array( $feature, array( 'db-query', 'chart-permissions' ), true ) ) { $msg = $plus_msg; } @@ -165,5 +165,4 @@ public function addProUpsell( $old, $feature = null ) { return $return; } - } diff --git a/classes/Visualizer/Module/Upgrade.php b/classes/Visualizer/Module/Upgrade.php index 630dafe12..5bf975b60 100644 --- a/classes/Visualizer/Module/Upgrade.php +++ b/classes/Visualizer/Module/Upgrade.php @@ -71,6 +71,5 @@ private static function makeAllTableChartsTabular() { AND pm.meta_value IN ( 'dataTable', 'table' )" ); // phpcs:enable WordPress.DB.PreparedSQL.NotPrepared - } } diff --git a/classes/Visualizer/Plugin.php b/classes/Visualizer/Plugin.php index 62f6724e9..85cbfd425 100644 --- a/classes/Visualizer/Plugin.php +++ b/classes/Visualizer/Plugin.php @@ -222,10 +222,10 @@ public function hasModule( $name ) { * * @access public * - * @param string $class The name of the module to use in the plugin. + * @param string $class_name The name of the module to use in the plugin. */ - public function setModule( $class ) { - $this->_modules[ $class ] = new $class( $this ); + public function setModule( $class_name ) { + $this->_modules[ $class_name ] = new $class_name( $this ); } /** @@ -241,11 +241,10 @@ private function __clone() { /** * For local testing, overrides the 'themeisle_log_event' hook and redirects to error.log. */ - final function themeisle_log_event_debug( $name, $message, $type, $file, $line ) { + final public function themeisle_log_event_debug( $name, $message, $type, $file, $line ) { if ( Visualizer_Plugin::NAME !== $name ) { return; } error_log( sprintf( '%s (%s): %s in %s:%s', $name, $type, $message, $file, $line ) ); } - } diff --git a/classes/Visualizer/Render.php b/classes/Visualizer/Render.php index bcb036fce..93b51bf30 100644 --- a/classes/Visualizer/Render.php +++ b/classes/Visualizer/Render.php @@ -112,7 +112,7 @@ public function __unset( $name ) { * @abstract * @access protected */ - protected abstract function _toHTML(); + abstract protected function _toHTML(); /** * Builds template and return it as string. @@ -215,6 +215,4 @@ protected function can_chart_have_action( $action, $chart_id = null ) { return true; } - - } diff --git a/classes/Visualizer/Render/Layout.php b/classes/Visualizer/Render/Layout.php index a89353ef5..0585c5024 100644 --- a/classes/Visualizer/Render/Layout.php +++ b/classes/Visualizer/Render/Layout.php @@ -390,7 +390,6 @@ public static function _renderSimpleEditorScreen( $args ) {

@@ -1017,8 +1016,8 @@ class="dashicons dashicons-lock"> + value="" + data-viz-link=""> '; - } /** * Renders library content. @@ -287,7 +286,7 @@ private function _renderLibrary() { $count = 0; foreach ( $this->charts as $placeholder_id => $chart ) { // show the sidebar after the first 3 charts. - $count++; + ++$count; $enable_controls = false; $settings = isset( $chart['settings'] ) ? $chart['settings'] : array(); if ( ! empty( $settings['controls']['controlType'] ) ) { @@ -400,7 +399,7 @@ private function _renderChartBox( $placeholder_id, $chart_id, $with_filter = fal ); $chart_type = get_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_TYPE, true ); - $types = ['area', 'geo', 'column', 'bubble', 'scatter', 'gauge', 'candlestick', 'timeline', 'combo', 'polarArea', 'radar' ]; + $types = array( 'area', 'geo', 'column', 'bubble', 'scatter', 'gauge', 'candlestick', 'timeline', 'combo', 'polarArea', 'radar' ); $pro_class = ''; @@ -477,5 +476,4 @@ private function _renderSidebar() { echo ''; } } - } diff --git a/classes/Visualizer/Render/Page.php b/classes/Visualizer/Render/Page.php index aa5eacd6c..5f70c1e0c 100644 --- a/classes/Visualizer/Render/Page.php +++ b/classes/Visualizer/Render/Page.php @@ -86,5 +86,4 @@ protected function _renderSidebarContent() {} * @access protected */ protected function _renderToolbar() {} - } diff --git a/classes/Visualizer/Render/Page/Data.php b/classes/Visualizer/Render/Page/Data.php index 9e248ec48..6730db0bd 100644 --- a/classes/Visualizer/Render/Page/Data.php +++ b/classes/Visualizer/Render/Page/Data.php @@ -93,7 +93,7 @@ protected function _renderSidebarContent() {
- +
@@ -156,5 +156,4 @@ private function add_additional_content() { Visualizer_Render_Layout::show( 'db-query', $query, $this->chart->ID ); Visualizer_Render_Layout::show( 'json-screen', $this->chart->ID ); } - } diff --git a/classes/Visualizer/Render/Page/Send.php b/classes/Visualizer/Render/Page/Send.php index 3f21f2c26..b1cb52483 100644 --- a/classes/Visualizer/Render/Page/Send.php +++ b/classes/Visualizer/Render/Page/Send.php @@ -53,5 +53,4 @@ protected function _toHTML() { echo ''; echo ''; } - } diff --git a/classes/Visualizer/Render/Page/Settings.php b/classes/Visualizer/Render/Page/Settings.php index e3b1d37b0..a8133eb74 100644 --- a/classes/Visualizer/Render/Page/Settings.php +++ b/classes/Visualizer/Render/Page/Settings.php @@ -80,5 +80,4 @@ protected function _toHTML() { protected function _renderSidebarContent() { echo $this->sidebar; } - } diff --git a/classes/Visualizer/Render/Page/Update.php b/classes/Visualizer/Render/Page/Update.php index 0eb54d3fa..c9f8f6735 100644 --- a/classes/Visualizer/Render/Page/Update.php +++ b/classes/Visualizer/Render/Page/Update.php @@ -91,5 +91,4 @@ private function updateEditorAndSettings() { return 'win.vizUpdateHTML(' . json_encode( array( 'html' => $editor ) ) . ', ' . json_encode( array( 'html' => $sidebar ) ) . ');'; } - } diff --git a/classes/Visualizer/Render/Sidebar.php b/classes/Visualizer/Render/Sidebar.php index 79e400b43..5e13bd01f 100644 --- a/classes/Visualizer/Render/Sidebar.php +++ b/classes/Visualizer/Render/Sidebar.php @@ -208,7 +208,6 @@ protected function _renderAdvancedSettings() { self::_renderSectionEnd(); self::_renderGroupEnd(); - } /** @@ -276,7 +275,7 @@ protected function _renderActionSettings() { private static function is_excel_enabled() { $vendor_file = VISUALIZER_ABSPATH . '/vendor/autoload.php'; if ( is_readable( $vendor_file ) ) { - include_once( $vendor_file ); + include_once $vendor_file; } if ( version_compare( phpversion(), '5.6.0', '<' ) ) { @@ -313,7 +312,7 @@ public static function _renderSelectItem( $title, $name, $value, array $options, echo '
'; echo '[?]'; echo '', $title, ''; - echo ''; foreach ( $options as $key => $label ) { // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict $extra = $multiple && is_array( $value ) ? ( in_array( $key, $value ) ? 'selected' : '' ) : selected( $key, $value, false ); @@ -336,13 +335,13 @@ public static function _renderSelectItem( $title, $name, $value, array $options, * @param string $title The title of the select item. * @param string $name The name of the select item. * @param string $value The actual value of the select item. - * @param string $default The default value of the color picker. + * @param string $default_color The default value of the color picker. */ - protected static function _renderColorPickerItem( $title, $name, $value, $default ) { + protected static function _renderColorPickerItem( $title, $name, $value, $default_color ) { echo '
'; echo '', $title, ''; echo '
'; - echo ''; + echo ''; echo '
'; echo '
'; } @@ -387,10 +386,10 @@ protected static function _renderTextItem( $title, $name, $value, $desc, $placeh * @access public * @param string $title The title of this group. * @param string $html Any additional HTML. - * @param string $class Any additional classes. + * @param string $extra_class Any additional classes. */ - public static function _renderGroupStart( $title, $html = '', $class = '', $id = '' ) { - echo '
  • '; + public static function _renderGroupStart( $title, $html = '', $extra_class = '', $id = '' ) { + echo '
  • '; echo '

    ', $title, '

    '; echo $html; echo '
      '; @@ -506,12 +505,11 @@ protected function _renderFormatField( $index = 0 ) { /** * Render a checkbox item */ - protected static function _renderCheckboxItem( $title, $name, $value, $default, $desc, $disabled = false ) { + protected static function _renderCheckboxItem( $title, $name, $value, $default_value, $desc, $disabled = false ) { echo '
      '; echo '[?]'; echo '', $title, ''; - // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison - echo ''; + echo ''; echo '

      ', $desc, '

      '; echo '
      '; } @@ -552,7 +550,6 @@ protected function load_dependent_assets( $libs ) { if ( in_array( 'numeral', $libs, true ) && ! wp_script_is( 'numeral', 'registered' ) ) { wp_register_script( 'numeral', VISUALIZER_ABSURL . 'js/lib/numeral.min.js', array(), Visualizer_Plugin::VERSION ); } - } /** @@ -656,8 +653,8 @@ protected function _renderChartControlsSettings() { array( 'vz-controls-opt' ) ); - $column_index = [ 'false' => '' ]; - $column_label = [ 'false' => '' ]; + $column_index = array( 'false' => '' ); + $column_label = array( 'false' => '' ); if ( ! empty( $this->__series ) ) { foreach ( $this->__series as $key => $column ) { $column_type = isset( $column['type'] ) ? $column['type'] : ''; diff --git a/classes/Visualizer/Render/Sidebar/ChartJS.php b/classes/Visualizer/Render/Sidebar/ChartJS.php index d4da43b31..1323e6c2e 100644 --- a/classes/Visualizer/Render/Sidebar/ChartJS.php +++ b/classes/Visualizer/Render/Sidebar/ChartJS.php @@ -38,7 +38,6 @@ public function __construct( $data = array() ) { 'bottom' => esc_html__( 'Below the chart', 'visualizer' ), 'none' => esc_html__( 'Omit the legend', 'visualizer' ), ); - } /** @@ -78,7 +77,7 @@ protected function hooks() { /** * Loads the assets. */ - function load_chartjs_assets( $deps, $is_frontend ) { + public function load_chartjs_assets( $deps, $is_frontend ) { $this->load_dependent_assets( array( 'moment', 'numeral' ) ); wp_register_script( 'chartjs', VISUALIZER_ABSURL . 'js/lib/chartjs.min.js', array( 'numeral', 'moment' ), null, true ); @@ -96,7 +95,6 @@ function load_chartjs_assets( $deps, $is_frontend ) { $deps, array( 'visualizer-render-chartjs-lib' ) ); - } /** @@ -133,7 +131,6 @@ protected function _renderSeriesSettings() { protected function _renderSeries( $index ) { $this->_renderFormatField( $index ); $this->_renderChartTypeSeries( $index ); - } /** @@ -187,7 +184,6 @@ protected function _renderChartTitleSettings() { '' ) ); - } /** @@ -367,7 +363,6 @@ protected function _renderAnimationSettings() { ); self::_renderSectionEnd(); - } /** diff --git a/classes/Visualizer/Render/Sidebar/Columnar.php b/classes/Visualizer/Render/Sidebar/Columnar.php index 460043b9e..1a1af1709 100644 --- a/classes/Visualizer/Render/Sidebar/Columnar.php +++ b/classes/Visualizer/Render/Sidebar/Columnar.php @@ -110,5 +110,4 @@ protected function _renderHorizontalAxisGeneralSettings() { '#000' ); } - } diff --git a/classes/Visualizer/Render/Sidebar/Google.php b/classes/Visualizer/Render/Sidebar/Google.php index 3f7cd8198..5810cc1ed 100644 --- a/classes/Visualizer/Render/Sidebar/Google.php +++ b/classes/Visualizer/Render/Sidebar/Google.php @@ -82,7 +82,6 @@ public function __construct( $data = array() ) { 'center' => esc_html__( 'Centered in the allocated area', 'visualizer' ), 'end' => esc_html__( 'Aligned to the end of the allocated area', 'visualizer' ), ); - } /** @@ -99,7 +98,7 @@ protected function hooks() { /** * Loads the assets. */ - function load_google_assets( $deps, $is_frontend ) { + public function load_google_assets( $deps, $is_frontend ) { wp_register_script( 'google-jsapi', '//www.gstatic.com/charts/loader.js', array(), null, true ); wp_register_script( 'dom-to-image', VISUALIZER_ABSURL . 'js/lib/dom-to-image.min.js', array(), null, true ); wp_register_script( @@ -117,7 +116,6 @@ function load_google_assets( $deps, $is_frontend ) { $deps, array( 'visualizer-render-google-lib' ) ); - } /** @@ -309,7 +307,6 @@ protected function _renderAnimationSettings() { ); self::_renderSectionEnd(); - } /** diff --git a/classes/Visualizer/Render/Sidebar/Graph.php b/classes/Visualizer/Render/Sidebar/Graph.php index 7ee73de7b..80a2a51a9 100644 --- a/classes/Visualizer/Render/Sidebar/Graph.php +++ b/classes/Visualizer/Render/Sidebar/Graph.php @@ -136,7 +136,6 @@ protected function _renderChartTitleSettings() { '' ) ); - } /** @@ -461,7 +460,6 @@ protected function _renderSeries( $index ) { ); $this->_renderRoleField( $index ); - } /** @@ -525,5 +523,4 @@ protected function _renderVerticalAxisFormatField() { ) ); } - } diff --git a/classes/Visualizer/Render/Sidebar/Linear.php b/classes/Visualizer/Render/Sidebar/Linear.php index 5769f4bc4..7a7b250f8 100644 --- a/classes/Visualizer/Render/Sidebar/Linear.php +++ b/classes/Visualizer/Render/Sidebar/Linear.php @@ -291,7 +291,5 @@ protected function _renderSeries( $index ) { ); $this->_renderRoleField( $index ); - } - } diff --git a/classes/Visualizer/Render/Sidebar/Type/ChartJS/Bar.php b/classes/Visualizer/Render/Sidebar/Type/ChartJS/Bar.php index 807ae4376..7f0bdb385 100644 --- a/classes/Visualizer/Render/Sidebar/Type/ChartJS/Bar.php +++ b/classes/Visualizer/Render/Sidebar/Type/ChartJS/Bar.php @@ -131,6 +131,5 @@ protected function _renderChartTypeSettings() { self::_renderSectionEnd(); self::_renderGroupEnd(); - } } diff --git a/classes/Visualizer/Render/Sidebar/Type/ChartJS/Linear.php b/classes/Visualizer/Render/Sidebar/Type/ChartJS/Linear.php index a1646331b..f42cac084 100644 --- a/classes/Visualizer/Render/Sidebar/Type/ChartJS/Linear.php +++ b/classes/Visualizer/Render/Sidebar/Type/ChartJS/Linear.php @@ -79,7 +79,6 @@ protected function _renderHorizontalTickSettings() { ); self::_renderSectionEnd(); - } /** @@ -124,7 +123,6 @@ protected function _renderVerticalTickSettings() { ); self::_renderSectionEnd(); - } /** @@ -318,6 +316,5 @@ protected function _renderVerticalAxisGeneralSettings() { ); self::_renderSectionEnd(); - } } diff --git a/classes/Visualizer/Render/Sidebar/Type/ChartJS/Pie.php b/classes/Visualizer/Render/Sidebar/Type/ChartJS/Pie.php index 987dbf202..96fb590b7 100644 --- a/classes/Visualizer/Render/Sidebar/Type/ChartJS/Pie.php +++ b/classes/Visualizer/Render/Sidebar/Type/ChartJS/Pie.php @@ -86,7 +86,6 @@ protected function _renderSliceSettings( $index ) { isset( $this->slices[ $index ]['hoverBackgroundColor'] ) ? $this->slices[ $index ]['hoverBackgroundColor'] : null, null ); - } /** diff --git a/classes/Visualizer/Render/Sidebar/Type/DataTable/DataTable.php b/classes/Visualizer/Render/Sidebar/Type/DataTable/DataTable.php index fd48a5130..f54fae500 100644 --- a/classes/Visualizer/Render/Sidebar/Type/DataTable/DataTable.php +++ b/classes/Visualizer/Render/Sidebar/Type/DataTable/DataTable.php @@ -60,7 +60,7 @@ protected function hooks() { * * @access public */ - function load_assets( $deps, $is_frontend ) { + public function load_assets( $deps, $is_frontend ) { $this->load_dependent_assets( array( 'moment' ) ); wp_register_script( 'visualizer-datatables', VISUALIZER_ABSURL . 'js/lib/datatables.min.js', array( 'jquery-ui-core', 'moment' ), Visualizer_Plugin::VERSION ); @@ -103,7 +103,7 @@ protected function _toHTML() { $this->_supportsAnimation = false; $this->_renderGeneralSettings(); $this->_renderTableSettings(); - $this->_renderColumnSettings(); + $this->_renderColumnSettings(); $this->_renderAdvancedSettings(); } @@ -523,5 +523,4 @@ protected function _renderFormatField( $index = 0 ) { break; } } - } diff --git a/classes/Visualizer/Render/Sidebar/Type/DataTable/Tabular.php b/classes/Visualizer/Render/Sidebar/Type/DataTable/Tabular.php index 7839f34dc..d84334fd7 100644 --- a/classes/Visualizer/Render/Sidebar/Type/DataTable/Tabular.php +++ b/classes/Visualizer/Render/Sidebar/Type/DataTable/Tabular.php @@ -58,7 +58,7 @@ protected function hooks() { * * @access public */ - function load_assets( $deps, $is_frontend ) { + public function load_assets( $deps, $is_frontend ) { $this->load_dependent_assets( array( 'moment' ) ); wp_register_script( 'visualizer-datatables', VISUALIZER_ABSURL . 'js/lib/datatables.min.js', array( 'jquery-ui-core', 'moment' ), Visualizer_Plugin::VERSION ); @@ -101,7 +101,7 @@ protected function _toHTML() { $this->_supportsAnimation = false; $this->_renderGeneralSettings(); $this->_renderTableSettings(); - $this->_renderColumnSettings(); + $this->_renderColumnSettings(); $this->_renderAdvancedSettings(); } @@ -499,5 +499,4 @@ protected function _renderFormatField( $index = 0 ) { break; } } - } diff --git a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Area.php b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Area.php index d4a522362..3d5c0bce4 100644 --- a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Area.php +++ b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Area.php @@ -148,5 +148,4 @@ protected function _renderSeries( $index ) { null ); } - } diff --git a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Bar.php b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Bar.php index fb1f38a55..098f8a8e3 100644 --- a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Bar.php +++ b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Bar.php @@ -72,5 +72,4 @@ protected function _toHTML() { $this->_renderViewSettings(); $this->_renderAdvancedSettings(); } - } diff --git a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Bubble.php b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Bubble.php index 203ad8874..28d2761a0 100644 --- a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Bubble.php +++ b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Bubble.php @@ -115,8 +115,5 @@ protected function _renderBubbleSettings() { self::_renderSectionEnd(); self::_renderGroupEnd(); - } - - } diff --git a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Candlestick.php b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Candlestick.php index 04eec1042..453d469b3 100644 --- a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Candlestick.php +++ b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Candlestick.php @@ -175,5 +175,4 @@ protected function _renderSeries( $index ) { null ); } - } diff --git a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Column.php b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Column.php index a9f8024e1..24ee5e3cb 100644 --- a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Column.php +++ b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Column.php @@ -72,5 +72,4 @@ protected function _toHTML() { $this->_renderViewSettings(); $this->_renderAdvancedSettings(); } - } diff --git a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Gauge.php b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Gauge.php index a3529e8a4..56a2c4db1 100644 --- a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Gauge.php +++ b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Gauge.php @@ -309,5 +309,4 @@ protected function _renderViewSettings() { self::_renderSectionEnd(); self::_renderGroupEnd(); } - } diff --git a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Geo.php b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Geo.php index 4b72929bc..2c07589c1 100644 --- a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Geo.php +++ b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Geo.php @@ -465,5 +465,4 @@ protected function _renderViewSettings() { self::_renderSectionEnd(); self::_renderGroupEnd(); } - } diff --git a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Line.php b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Line.php index 8f2f786d5..e8c954353 100644 --- a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Line.php +++ b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Line.php @@ -66,5 +66,4 @@ protected function _renderLineSettingsItems() { esc_html__( 'Whether to guess the value of missing points. If yes, it will guess the value of any missing data based on neighboring points. If no, it will leave a break in the line at the unknown point.', 'visualizer' ) ); } - } diff --git a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Pie.php b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Pie.php index 16c2a0840..17e4624bc 100644 --- a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Pie.php +++ b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Pie.php @@ -229,5 +229,4 @@ protected function _renderTooltipSettigns() { esc_html__( 'Determines what information to display when the user hovers over a pie slice.', 'visualizer' ) ); } - } diff --git a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Scatter.php b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Scatter.php index 7706d3369..ae1b4c534 100644 --- a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Scatter.php +++ b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Scatter.php @@ -60,5 +60,4 @@ protected function _toHTML() { $this->_renderViewSettings(); $this->_renderAdvancedSettings(); } - } diff --git a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Tabular.php b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Tabular.php index 163645c11..30a8a303c 100644 --- a/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Tabular.php +++ b/classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Tabular.php @@ -410,5 +410,4 @@ protected function _renderSeries( $index ) { protected function _renderSeriesSettings() { parent::_renderSeriesSettings(); } - } diff --git a/classes/Visualizer/Render/Templates.php b/classes/Visualizer/Render/Templates.php index 26676e2af..d8998a66f 100644 --- a/classes/Visualizer/Render/Templates.php +++ b/classes/Visualizer/Render/Templates.php @@ -105,5 +105,4 @@ protected function _toHTML() { $this->_renderTemplate( $template, $callback ); } } - } diff --git a/classes/Visualizer/Source.php b/classes/Visualizer/Source.php index 7b3d6b597..ecd186249 100644 --- a/classes/Visualizer/Source.php +++ b/classes/Visualizer/Source.php @@ -109,7 +109,7 @@ protected static function _validateTypes( $types ) { * @access public * @return string The name of source. */ - public abstract function getSourceName(); + abstract public function getSourceName(); /** * Fetches information from source, parses it and builds series and data arrays. @@ -119,7 +119,7 @@ public abstract function getSourceName(); * @abstract * @access public */ - public abstract function fetch(); + abstract public function fetch(); /** * Returns series parsed from source. @@ -263,7 +263,7 @@ protected function _normalizeData( $data ) { * * @return string The converted data. */ - protected final function toUTF8( $datum ) { + final protected function toUTF8( $datum ) { if ( ! function_exists( 'mb_detect_encoding' ) || mb_detect_encoding( $datum ) !== 'ASCII' ) { $datum = \ForceUTF8\Encoding::toUTF8( $datum ); } @@ -280,7 +280,7 @@ protected final function toUTF8( $datum ) { * * @return array */ - public static final function get_date_formats_if_exists( $series, $data ) { + final public static function get_date_formats_if_exists( $series, $data ) { $date_formats = array(); $types = array(); $index = 0; @@ -288,7 +288,7 @@ public static final function get_date_formats_if_exists( $series, $data ) { if ( in_array( $column['type'], array( 'date', 'datetime', 'timeofday' ), true ) ) { $types[] = array( 'index' => $index, 'type' => $column['type'] ); } - $index++; + ++$index; } if ( ! $types ) { @@ -474,6 +474,4 @@ private function _fetchDataFromEditableTable() { return true; } - - } diff --git a/classes/Visualizer/Source/Csv.php b/classes/Visualizer/Source/Csv.php index 796658646..5d4e91873 100644 --- a/classes/Visualizer/Source/Csv.php +++ b/classes/Visualizer/Source/Csv.php @@ -143,9 +143,10 @@ public function fetch() { } // fetch data - // phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition - while ( ( $data = fgetcsv( $handle, 0, VISUALIZER_CSV_DELIMITER, VISUALIZER_CSV_ENCLOSURE ) ) !== false ) { + $data = fgetcsv( $handle, 0, VISUALIZER_CSV_DELIMITER, VISUALIZER_CSV_ENCLOSURE ); + while ( $data !== false ) { $this->_data[] = $this->_normalizeData( $data ); + $data = fgetcsv( $handle, 0, VISUALIZER_CSV_DELIMITER, VISUALIZER_CSV_ENCLOSURE ); } // close file handle diff --git a/classes/Visualizer/Source/Csv/Remote.php b/classes/Visualizer/Source/Csv/Remote.php index 3261133a1..e034ca15e 100644 --- a/classes/Visualizer/Source/Csv/Remote.php +++ b/classes/Visualizer/Source/Csv/Remote.php @@ -161,5 +161,4 @@ protected function _get_file_handle( $filename = false ) { return ! is_wp_error( $this->_tmpfile ) ? parent::_get_file_handle( $this->_tmpfile ) : false; } - } diff --git a/classes/Visualizer/Source/Json.php b/classes/Visualizer/Source/Json.php index 2961cd3ba..027b4c0fc 100644 --- a/classes/Visualizer/Source/Json.php +++ b/classes/Visualizer/Source/Json.php @@ -321,7 +321,6 @@ private function collectCommonElements( $data ) { } return $rows; - } /** @@ -331,7 +330,7 @@ private function collectCommonElements( $data ) { * * @access private */ - private function getNextPage( $array ) { + private function getNextPage( $data ) { if ( empty( $this->_paging ) ) { return null; } @@ -339,10 +338,10 @@ private function getNextPage( $array ) { $root = explode( self::TAG_SEPARATOR, $this->_paging ); // get rid of the first element as that is the faux root element indicator array_shift( $root ); - $leaf = $array; + $leaf = $data; foreach ( $root as $tag ) { if ( array_key_exists( $tag, $leaf ) ) { - $leaf = $array[ $tag ]; + $leaf = $data[ $tag ]; } else { // if the tag does not exist, we assume it is present in the 0th element of the current array. // TODO: we may want to change this to a filter later. @@ -362,19 +361,19 @@ private function getNextPage( $array ) { * * @access private */ - private function getRootElements( $parent, $now, $root, $array ) { - if ( is_null( $array ) ) { + private function getRootElements( $parent_key, $now, $root, $data ) { + if ( is_null( $data ) ) { return null; } - $root[] = $parent; - foreach ( $array as $key => $value ) { + $root[] = $parent_key; + foreach ( $data as $key => $value ) { if ( is_array( $value ) && ! empty( $value ) ) { if ( ! is_numeric( $key ) ) { - $now = sprintf( '%s%s%s', $parent, self::TAG_SEPARATOR, $key ); + $now = sprintf( '%s%s%s', $parent_key, self::TAG_SEPARATOR, $key ); $root[] = $now; } else { - $now = $parent; + $now = $parent_key; } $root = $this->getRootElements( $now, $key, $root, $value ); } @@ -442,7 +441,7 @@ private function connect( $url ) { $this->_additional_headers = array_filter( $this->_additional_headers ); if ( ! empty( $this->_additional_headers ) ) { $this->_additional_headers = array_map( - function( $headers ) { + function ( $headers ) { $headers = explode( ':', $headers ); $headers = array_map( 'trim', $headers ); return $headers; @@ -555,5 +554,4 @@ private function is_woocommerce_request( $url ) { public function getSourceName() { return __CLASS__; } - } diff --git a/classes/Visualizer/Source/Query.php b/classes/Visualizer/Source/Query.php index 9b9f6622e..b08798c8e 100644 --- a/classes/Visualizer/Source/Query.php +++ b/classes/Visualizer/Source/Query.php @@ -152,7 +152,8 @@ function ( $value ) { $headers = array(); // short circuit results for remote dbs. - if ( false !== ( $remote_results = apply_filters( 'visualizer_db_query_execute', false, $this->_query, $as_html, $results_as_numeric_array, $raw_results, $this->_chart_id, $this->_params ) ) ) { + $remote_results = apply_filters( 'visualizer_db_query_execute', false, $this->_query, $as_html, $results_as_numeric_array, $raw_results, $this->_chart_id, $this->_params ); + if ( false !== $remote_results ) { $error = $remote_results['error']; if ( empty( $error ) ) { $results = $remote_results['results']; @@ -180,7 +181,7 @@ function ( $value ) { if ( $wpdb->last_error ) { $this->_error = $wpdb->last_error; - return []; + return array(); } if ( $rows ) { @@ -198,7 +199,7 @@ function ( $value ) { } } $results[] = $result; - $row_num++; + ++$row_num; } } diff --git a/classes/Visualizer/Source/Query/Params.php b/classes/Visualizer/Source/Query/Params.php index 0309a9916..528b23ec6 100644 --- a/classes/Visualizer/Source/Query/Params.php +++ b/classes/Visualizer/Source/Query/Params.php @@ -79,7 +79,7 @@ private function rearrange_columns_for_x_axis( $columns, $select, $tables ) { } } } - $index++; + ++$index; } if ( $first ) { diff --git a/composer.json b/composer.json index dee763adc..1e76b0961 100644 --- a/composer.json +++ b/composer.json @@ -48,7 +48,7 @@ } }, "require-dev": { - "wp-coding-standards/wpcs": "^2.3", + "wp-coding-standards/wpcs": "^3.3", "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", "phpcompatibility/phpcompatibility-wp": "*", "phpstan/phpstan": "^2.1", diff --git a/composer.lock b/composer.lock index 7d0aaec33..2becf81de 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "42014bd28da227466c93a0e2084644c8", + "content-hash": "f939ee5350ac149f2ec1e5fca3a9ec30", "packages": [ { "name": "codeinwp/themeisle-sdk", @@ -181,29 +181,29 @@ "packages-dev": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v1.0.0", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/composer-installer.git", - "reference": "4be43904336affa5c2f70744a348312336afd0da" + "reference": "845eb62303d2ca9b289ef216356568ccc075ffd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", - "reference": "4be43904336affa5c2f70744a348312336afd0da", + "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/845eb62303d2ca9b289ef216356568ccc075ffd1", + "reference": "845eb62303d2ca9b289ef216356568ccc075ffd1", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0 || ^2.0", + "composer-plugin-api": "^2.2", "php": ">=5.4", - "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + "squizlabs/php_codesniffer": "^3.1.0 || ^4.0" }, "require-dev": { - "composer/composer": "*", + "composer/composer": "^2.2", "ext-json": "*", "ext-zip": "*", - "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcompatibility/php-compatibility": "^9.0 || ^10.0.0@dev", "yoast/phpunit-polyfills": "^1.0" }, "type": "composer-plugin", @@ -222,9 +222,9 @@ "authors": [ { "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" + "email": "opensource@frenck.dev", + "homepage": "https://frenck.dev", + "role": "Open source developer" }, { "name": "Contributors", @@ -232,7 +232,6 @@ } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", "keywords": [ "PHPCodeSniffer", "PHP_CodeSniffer", @@ -253,9 +252,28 @@ ], "support": { "issues": "https://github.com/PHPCSStandards/composer-installer/issues", + "security": "https://github.com/PHPCSStandards/composer-installer/security/policy", "source": "https://github.com/PHPCSStandards/composer-installer" }, - "time": "2023-01-05T11:28:13+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2025-11-11T04:32:07+00:00" }, { "name": "doctrine/instantiator", @@ -828,6 +846,181 @@ ], "time": "2025-10-18T00:05:59+00:00" }, + { + "name": "phpcsstandards/phpcsextra", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", + "reference": "b598aa890815b8df16363271b659d73280129101" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/b598aa890815b8df16363271b659d73280129101", + "reference": "b598aa890815b8df16363271b659d73280129101", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "phpcsstandards/phpcsutils": "^1.2.0", + "squizlabs/php_codesniffer": "^3.13.5 || ^4.0.1" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcsstandards/phpcsdevcs": "^1.2.0", + "phpcsstandards/phpcsdevtools": "^1.2.1", + "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-stable": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" + } + ], + "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", + "keywords": [ + "PHP_CodeSniffer", + "phpcbf", + "phpcodesniffer-standard", + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", + "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy", + "source": "https://github.com/PHPCSStandards/PHPCSExtra" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2025-11-12T23:06:57+00:00" + }, + { + "name": "phpcsstandards/phpcsutils", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", + "reference": "c216317e96c8b3f5932808f9b0f1f7a14e3bbf55" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/c216317e96c8b3f5932808f9b0f1f7a14e3bbf55", + "reference": "c216317e96c8b3f5932808f9b0f1f7a14e3bbf55", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", + "php": ">=5.4", + "squizlabs/php_codesniffer": "^3.13.5 || ^4.0.1" + }, + "require-dev": { + "ext-filter": "*", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcsstandards/phpcsdevcs": "^1.2.0", + "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0 || ^3.0.0" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-stable": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, + "autoload": { + "classmap": [ + "PHPCSUtils/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" + } + ], + "description": "A suite of utility functions for use with PHP_CodeSniffer", + "homepage": "https://phpcsutils.com/", + "keywords": [ + "PHP_CodeSniffer", + "phpcbf", + "phpcodesniffer-standard", + "phpcs", + "phpcs3", + "phpcs4", + "standards", + "static analysis", + "tokens", + "utility" + ], + "support": { + "docs": "https://phpcsutils.com/", + "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", + "security": "https://github.com/PHPCSStandards/PHPCSUtils/security/policy", + "source": "https://github.com/PHPCSStandards/PHPCSUtils" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2025-12-08T14:27:58+00:00" + }, { "name": "phpstan/phpstan", "version": "2.1.40", @@ -2324,16 +2517,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.13.4", + "version": "3.13.5", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "ad545ea9c1b7d270ce0fc9cbfb884161cd706119" + "reference": "0ca86845ce43291e8f5692c7356fccf3bcf02bf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/ad545ea9c1b7d270ce0fc9cbfb884161cd706119", - "reference": "ad545ea9c1b7d270ce0fc9cbfb884161cd706119", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/0ca86845ce43291e8f5692c7356fccf3bcf02bf4", + "reference": "0ca86845ce43291e8f5692c7356fccf3bcf02bf4", "shasum": "" }, "require": { @@ -2350,11 +2543,6 @@ "bin/phpcs" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" @@ -2404,7 +2592,7 @@ "type": "thanks_dev" } ], - "time": "2025-09-05T05:47:09+00:00" + "time": "2025-11-04T16:30:35+00:00" }, { "name": "szepeviktor/phpstan-wordpress", @@ -2521,30 +2709,38 @@ }, { "name": "wp-coding-standards/wpcs", - "version": "2.3.0", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "7da1894633f168fe244afc6de00d141f27517b62" + "reference": "7795ec6fa05663d716a549d0b44e47ffc8b0d4a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", - "reference": "7da1894633f168fe244afc6de00d141f27517b62", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7795ec6fa05663d716a549d0b44e47ffc8b0d4a6", + "reference": "7795ec6fa05663d716a549d0b44e47ffc8b0d4a6", "shasum": "" }, "require": { - "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.3.1" + "ext-filter": "*", + "ext-libxml": "*", + "ext-tokenizer": "*", + "ext-xmlreader": "*", + "php": ">=7.2", + "phpcsstandards/phpcsextra": "^1.5.0", + "phpcsstandards/phpcsutils": "^1.1.0", + "squizlabs/php_codesniffer": "^3.13.4" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", - "phpcompatibility/php-compatibility": "^9.0", - "phpcsstandards/phpcsdevtools": "^1.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcompatibility/php-compatibility": "^10.0.0@dev", + "phpcsstandards/phpcsdevtools": "^1.2.0", + "phpunit/phpunit": "^8.0 || ^9.0" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." + "ext-iconv": "For improved results", + "ext-mbstring": "For improved results" }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -2561,6 +2757,7 @@ "keywords": [ "phpcs", "standards", + "static analysis", "wordpress" ], "support": { @@ -2568,7 +2765,13 @@ "source": "https://github.com/WordPress/WordPress-Coding-Standards", "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" }, - "time": "2020-05-13T23:57:56+00:00" + "funding": [ + { + "url": "https://opencollective.com/php_codesniffer", + "type": "custom" + } + ], + "time": "2025-11-25T12:08:04+00:00" }, { "name": "yoast/phpunit-polyfills", diff --git a/index.php b/index.php index 484de429f..f167948fe 100644 --- a/index.php +++ b/index.php @@ -36,15 +36,15 @@ * * @since 1.0.0 * - * @param string $class The class name to autoload. + * @param string $class_name The class name to autoload. * * @return boolean Returns TRUE if the class is located. Otherwise FALSE. */ -function visualizer_autoloader( $class ) { +function visualizer_autoloader( $class_name ) { $namespaces = array( 'Visualizer' ); foreach ( $namespaces as $namespace ) { - if ( substr( $class, 0, strlen( $namespace ) ) === $namespace ) { - $filename = dirname( __FILE__ ) . str_replace( '_', DIRECTORY_SEPARATOR, "_classes_{$class}.php" ); + if ( substr( $class_name, 0, strlen( $namespace ) ) === $namespace ) { + $filename = __DIR__ . str_replace( '_', DIRECTORY_SEPARATOR, "_classes_{$class_name}.php" ); if ( is_readable( $filename ) ) { require $filename; @@ -66,7 +66,7 @@ function visualizer_launch() { define( 'VISUALIZER_BASEFILE', __FILE__ ); define( 'VISUALIZER_BASENAME', plugin_basename( __FILE__ ) ); define( 'VISUALIZER_ABSURL', plugins_url( '/', __FILE__ ) ); - define( 'VISUALIZER_ABSPATH', dirname( __FILE__ ) ); + define( 'VISUALIZER_ABSPATH', __DIR__ ); define( 'VISUALIZER_DIRNAME', basename( VISUALIZER_ABSPATH ) ); define( 'VISUALIZER_REST_VERSION', 1 ); // if the below is true, then the js/customization.js in the plugin folder will be used instead of the one in the uploads folder (if it exists). @@ -133,7 +133,7 @@ function visualizer_launch() { $vendor_file = VISUALIZER_ABSPATH . '/vendor/autoload.php'; if ( is_readable( $vendor_file ) ) { - include_once( $vendor_file ); + include_once $vendor_file; } add_filter( 'themeisle_sdk_products', 'visualizer_register_sdk', 10, 1 ); add_filter( 'pirate_parrot_log', 'visualizer_register_parrot', 10, 1 ); @@ -149,7 +149,7 @@ function visualizer_launch() { ); add_filter( 'visualizer_about_us_metadata', - function() { + function () { return array( 'logo' => esc_url( VISUALIZER_ABSURL . 'images/visualizer-logo.svg' ), 'location' => 'visualizer', @@ -164,7 +164,7 @@ function() { add_filter( 'themeisle_sdk_enable_telemetry', '__return_true' ); add_filter( 'themeisle_sdk_telemetry_products', - function( $products ) { + function ( $products ) { $already_registered = false; $license = get_option( 'visualizer_pro_license_data', 'free' ); diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 814cf6b89..44608ccd7 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -295,7 +295,7 @@ parameters: path: classes/Visualizer/Module.php - - message: '#^Method Visualizer_Module\:\:getDataAs\(\) has parameter \$final with no type specified\.$#' + message: '#^Method Visualizer_Module\:\:getDataAs\(\) has parameter \$data with no type specified\.$#' identifier: missingType.parameter count: 1 path: classes/Visualizer/Module.php @@ -2737,7 +2737,7 @@ parameters: path: classes/Visualizer/Render/Sidebar.php - - message: '#^Method Visualizer_Render_Sidebar\:\:_renderCheckboxItem\(\) has parameter \$default with no type specified\.$#' + message: '#^Method Visualizer_Render_Sidebar\:\:_renderCheckboxItem\(\) has parameter \$default_value with no type specified\.$#' identifier: missingType.parameter count: 1 path: classes/Visualizer/Render/Sidebar.php @@ -3415,7 +3415,7 @@ parameters: path: classes/Visualizer/Render/Sidebar/Graph.php - - message: '#^Parameter \#4 \$default of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' + message: '#^Parameter \#4 \$default_color of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' identifier: argument.type count: 3 path: classes/Visualizer/Render/Sidebar/Graph.php @@ -3511,7 +3511,7 @@ parameters: path: classes/Visualizer/Render/Sidebar/Linear.php - - message: '#^Parameter \#4 \$default of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' + message: '#^Parameter \#4 \$default_color of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' identifier: argument.type count: 1 path: classes/Visualizer/Render/Sidebar/Linear.php @@ -3541,7 +3541,7 @@ parameters: path: classes/Visualizer/Render/Sidebar/Type/ChartJS/Bar.php - - message: '#^Parameter \#4 \$default of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' + message: '#^Parameter \#4 \$default_color of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' identifier: argument.type count: 3 path: classes/Visualizer/Render/Sidebar/Type/ChartJS/Bar.php @@ -3577,7 +3577,7 @@ parameters: path: classes/Visualizer/Render/Sidebar/Type/ChartJS/Line.php - - message: '#^Parameter \#4 \$default of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' + message: '#^Parameter \#4 \$default_color of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' identifier: argument.type count: 2 path: classes/Visualizer/Render/Sidebar/Type/ChartJS/Line.php @@ -3685,7 +3685,7 @@ parameters: path: classes/Visualizer/Render/Sidebar/Type/ChartJS/Pie.php - - message: '#^Parameter \#4 \$default of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' + message: '#^Parameter \#4 \$default_color of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' identifier: argument.type count: 4 path: classes/Visualizer/Render/Sidebar/Type/ChartJS/Pie.php @@ -3841,7 +3841,7 @@ parameters: path: classes/Visualizer/Render/Sidebar/Type/DataTable/DataTable.php - - message: '#^Parameter \#4 \$default of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' + message: '#^Parameter \#4 \$default_color of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' identifier: argument.type count: 8 path: classes/Visualizer/Render/Sidebar/Type/DataTable/DataTable.php @@ -4003,7 +4003,7 @@ parameters: path: classes/Visualizer/Render/Sidebar/Type/DataTable/Tabular.php - - message: '#^Parameter \#4 \$default of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' + message: '#^Parameter \#4 \$default_color of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' identifier: argument.type count: 8 path: classes/Visualizer/Render/Sidebar/Type/DataTable/Tabular.php @@ -4057,7 +4057,7 @@ parameters: path: classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Area.php - - message: '#^Parameter \#4 \$default of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' + message: '#^Parameter \#4 \$default_color of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' identifier: argument.type count: 1 path: classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Area.php @@ -4105,7 +4105,7 @@ parameters: path: classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Bubble.php - - message: '#^Parameter \#4 \$default of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' + message: '#^Parameter \#4 \$default_color of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' identifier: argument.type count: 1 path: classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Bubble.php @@ -4153,7 +4153,7 @@ parameters: path: classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Candlestick.php - - message: '#^Parameter \#4 \$default of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' + message: '#^Parameter \#4 \$default_color of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' identifier: argument.type count: 5 path: classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Candlestick.php @@ -4453,7 +4453,7 @@ parameters: path: classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Geo.php - - message: '#^Parameter \#4 \$default of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' + message: '#^Parameter \#4 \$default_color of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' identifier: argument.type count: 1 path: classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Geo.php @@ -4567,7 +4567,7 @@ parameters: path: classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Pie.php - - message: '#^Parameter \#4 \$default of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' + message: '#^Parameter \#4 \$default_color of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' identifier: argument.type count: 1 path: classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Pie.php @@ -4693,7 +4693,7 @@ parameters: path: classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Tabular.php - - message: '#^Parameter \#4 \$default of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' + message: '#^Parameter \#4 \$default_color of static method Visualizer_Render_Sidebar\:\:_renderColorPickerItem\(\) expects string, null given\.$#' identifier: argument.type count: 14 path: classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Tabular.php @@ -5035,7 +5035,7 @@ parameters: path: classes/Visualizer/Source/Json.php - - message: '#^Method Visualizer_Source_Json\:\:getNextPage\(\) has parameter \$array with no type specified\.$#' + message: '#^Method Visualizer_Source_Json\:\:getNextPage\(\) has parameter \$data with no type specified\.$#' identifier: missingType.parameter count: 1 path: classes/Visualizer/Source/Json.php @@ -5053,7 +5053,7 @@ parameters: path: classes/Visualizer/Source/Json.php - - message: '#^Method Visualizer_Source_Json\:\:getRootElements\(\) has parameter \$array with no type specified\.$#' + message: '#^Method Visualizer_Source_Json\:\:getRootElements\(\) has parameter \$data with no type specified\.$#' identifier: missingType.parameter count: 1 path: classes/Visualizer/Source/Json.php @@ -5065,7 +5065,7 @@ parameters: path: classes/Visualizer/Source/Json.php - - message: '#^Method Visualizer_Source_Json\:\:getRootElements\(\) has parameter \$parent with no type specified\.$#' + message: '#^Method Visualizer_Source_Json\:\:getRootElements\(\) has parameter \$parent_key with no type specified\.$#' identifier: missingType.parameter count: 1 path: classes/Visualizer/Source/Json.php diff --git a/templates/support.php b/templates/support.php index 31b570b00..07e8c043f 100644 --- a/templates/support.php +++ b/templates/support.php @@ -21,17 +21,17 @@ class="dashicons dashicons-cart">More features