• Resolved phritzy

    (@phritzy)


    Dear @timmydcrawford, @apmwebdev!

    (See previus topic: https://wordpress.org/support/topic/registering-new-tab-in-settings-panel-not-works/)

    Sorry for the late reply, but I was on a short vacation. The error still exists. The WordPress environment contains only the necessary plugins, as I use this environment for development purposes only. I’m new in developing plugin for WordPress and in specially for WooCommerce and maybe there is a stupid error in my code, but I can not figure out where. My code was working before version 0.24 of the Woocommerce Admin.

    See my WordPress health report:

    ### wp-core ###

    version: 5.3.2
    site_language: hu_HU
    user_language: en_US
    timezone: Europe/Budapest
    permalink: /%postname%/
    https_status: false
    user_registration: 0
    default_comment_status: open
    multisite: false
    user_count: 2
    dotorg_communication: true

    ### wp-paths-sizes ###

    wordpress_path: /opt/lampp/htdocs/woo
    wordpress_size: 41.75 MB (43779814 bytes)
    uploads_path: /opt/lampp/htdocs/woo/wp-content/uploads
    uploads_size: 5.98 MB (6274969 bytes)
    themes_path: /opt/lampp/htdocs/woo/wp-content/themes
    themes_size: 5.22 MB (5472005 bytes)
    plugins_path: /opt/lampp/htdocs/woo/wp-content/plugins
    plugins_size: 66.50 MB (69730323 bytes)
    database_size: 3.30 MB (3457024 bytes)
    total_size: 122.75 MB (128714135 bytes)

    ### wp-active-theme ###

    name: Storefront (storefront)
    version: 2.5.3
    author: Automattic
    author_website: https://woocommerce.com/
    parent_theme: none
    theme_features: post-thumbnails, automatic-feed-links, custom-logo, menus, html5, custom-background, custom-header, site-logo, title-tag, customize-selective-refresh-widgets, wp-block-styles, align-wide, editor-styles, editor-font-sizes, editor-style, responsive-embeds, woocommerce, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider, starter-content, widgets, infinite-scroll
    theme_path: /opt/lampp/htdocs/woo/wp-content/themes/storefront

    ### wp-themes-inactive (1) ###

    Twenty Twenty: version: 1.1, author: the WordPress team

    ### wp-plugins-active (6) ###

    billzone.eu Invoice: version: 0.4.1, author: Ph
    Jetpack by WordPress.com: version: 8.1.1, author: Automattic
    WooCommerce: version: 3.9.0, author: Automattic
    WooCommerce Blocks: version: 2.5.11, author: Automattic
    WooCommerce PayPal Checkout Gateway: version: 1.6.18, author: WooCommerce
    WooCommerce Services: version: 1.22.3, author: Automattic

    ### wp-plugins-inactive (6) ###

    BlackBox: version: 0.1.3, author: Grzegorz Winiarski
    Classic Editor: version: 1.5, author: WordPress Contributors
    Debug Bar: version: 1.0, author: wordpressdotorg
    Debug Bar Actions and Filters Addon: version: 1.5.4, author: Subharanjan
    Loco Translate: version: 2.3.1, author: Tim Whitlock
    WooCommerce Admin: version: 0.24.0, author: WooCommerce

    ### wp-media ###

    image_editor: WP_Image_Editor_GD
    imagick_module_version: Not available
    imagemagick_version: Not available
    gd_version: bundled (2.1.0 compatible)
    ghostscript_version: 9.26

    ### wp-server ###

    server_architecture: Linux 4.15.0-74-generic x86_64
    httpd_software: Apache/2.4.39 (Unix) OpenSSL/1.0.2r PHP/7.3.4 mod_perl/2.0.8-dev Perl/v5.16.3
    php_version: 7.3.4 64bit
    php_sapi: apache2handler
    max_input_variables: 1000
    time_limit: 30
    memory_limit: 256M
    max_input_time: 60
    upload_max_size: 128M
    php_post_max_size: 128M
    curl_version: 7.45.0 OpenSSL/1.0.2r
    suhosin: false
    imagick_availability: false
    htaccess_extra_rules: true

    ### wp-database ###

    extension: mysqli
    server_version: 10.1.38-MariaDB
    client_version: mysqlnd 5.0.12-dev – 20150407 – $Id: 7cc7cc96e675f6d72e5cf0f267f48e167c2abb23 $

    ### wp-constants ###

    WP_HOME: undefined
    WP_SITEURL: undefined
    WP_CONTENT_DIR: /opt/lampp/htdocs/woo/wp-content
    WP_PLUGIN_DIR: /opt/lampp/htdocs/woo/wp-content/plugins
    WP_MAX_MEMORY_LIMIT: 256M
    WP_DEBUG: true
    WP_DEBUG_DISPLAY: true
    WP_DEBUG_LOG: true
    SCRIPT_DEBUG: false
    WP_CACHE: false
    CONCATENATE_SCRIPTS: undefined
    COMPRESS_SCRIPTS: undefined
    COMPRESS_CSS: undefined
    WP_LOCAL_DEV: undefined
    DB_CHARSET: utf8mb4
    DB_COLLATE: undefined

    ### wp-filesystem ###

    wordpress: writable
    wp-content: writable
    uploads: writable
    plugins: writable
    themes: writable

    ### jetpack ###

    site_id: false
    ssl_cert: No
    time_diff: undefined
    version_option: 6.8.1:1544791738
    old_version: 6.8.1:1544791738
    public: Private
    master_user: No master user set.
    current_user: #1 woo_admin (xxx@xxx.xx)
    tokens_set: None
    blog_token: Not set.
    user_token: Not set.
    version: 8.1.1
    jp_plugin_dir: /opt/lampp/htdocs/woo/wp-content/plugins/jetpack/
    plan: free
    HTTP_HOST: 192.168.10.213
    SERVER_PORT: 80
    REMOTE_ADDR: 192.168.10.187
    protect_header: false
    full_sync: {“started”:”Thu, 01 Jan 1970 00:00:00 +0000″,”queue_finished”:”Thu, 01 Jan 1970 00:00:00 +0000″,”send_started”:”Thu, 01 Jan 1970 00:00:00 +0000″,”finished”:”Thu, 01 Jan 1970 00:00:00 +0000″,”sent”:[],”sent_total”:[],”queue”:[],”config”:null,”total”:[]}
    sync_size: undefined
    sync_lag: 0 seconds
    full_sync_size: undefined
    full_sync_lag: 0 seconds
    idc_urls: {“home”:”http:\/\/192.168.10.213\/woo”,”siteurl”:”http:\/\/192.168.10.213\/woo”,”WP_HOME”:””,”WP_SITEURL”:””}
    idc_error_option: false
    idc_optin: true
    cxn_tests: [{“name”:”test__check_if_connected”,”pass”:false,”message”:”Jetpack is not connected.”,”resolution”:”Please disconnect and reconnect Jetpack.”,”action”:false,”severity”:”critical”,”group”:[“default”],”type”:”direct”}]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter phritzy

    (@phritzy)

    Can anyone help me or give me a suggestion?

    Hi @phritzy,

    Sorry for the wait on this – I tried your code from the previous thread:

    `
    //Add new settings tab
    add_action( ‘woocommerce_settings_tabs’, ‘wc_settings_tabs_customer_list_tab’ );
    function wc_settings_tabs_customer_list_tab() {
    $current_tab = ( isset($_GET[‘tab’]) && $_GET[‘tab’] === ‘customer_list’ ) ? ‘nav-tab-active’ : ”;
    echo ‘‘.__( “My custom tab”, “woocommerce” ).’‘;
    }

    // The setting tab content
    add_action( ‘woocommerce_settings_customer_list’, ‘display_customer_list_tab_content’ );
    function display_customer_list_tab_content() {
    global $wpdb;
    echo ‘<div>Some content</div>’;
    }
    `

    I received this error:

    `
    Your PHP code changes were rolled back due to an error on line 78 of file wp-content/themes/storefront/functions.php. Please fix and try saving again.

    syntax error, unexpected ‘custom’ (T_STRING), expecting ‘,’ or ‘)’
    `

    I did this with only WooCommerce enabled – no Admin, or any other plugin so it looks like it is just something with the particular code and Storefront. You will need to check with a developer regarding the code working with Storefront, and once it does it should work overall.

    I hope this helps!

    Thread Starter phritzy

    (@phritzy)

    Hi @nixiack8,
    Thank’s for your response. Well, I solved it differently, now there is no error. I think this topic can be closed. Thanks again.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘registering new tab in settings panel not works #2’ is closed to new replies.