Support » Plugin: PWA » Second word doesn’t show

  • Hi, i’m using your plugin on site
    My sites name is “Другой Маркетинг”, but in Google Chrome (on Android) I can see only first word “Другой”.

    Is this a bug?

    Here is my manifest file –

    P.S. when I try to validate it here – I see this error^

    Error: Manifest is invalid!
    Manifest URL:
    File isn't valid JSON: SyntaxError: Unexpected token  in JSON at position 0
    Your JSON failed to parse, these are the main reasons why JSON parsing usually fails:
    - Double quotes should be used around property names and for strings. Single quotes are not valid.
    - JSON specification disallow trailing comma after the last property even if some implementations allow it.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Weston Ruter


    @codeby Hi there.

    The logic for determining the short_name can be found here:

    Basically, it tries to truncate the name so it fits within 12 characters. It’s becoming increasingly clear that this logic is not going to work often and the short_name should be eliminated so that the full name is just truncated with an ellipsis or however an OS normally shows the title.

    Perhaps there should be a message when editing the Site Title that it should be less than 12 or provide a secondary app title field that should be shorter.

    Plugin Author Weston Ruter


    I’ve filed an issue you can follow regarding short_name:

    In regards to the manifest, it’s able to be loaded properly in Chrome.

    But if I try parsing it from the command line via curl I get no such luck:

    $ curl -s | python -m json.tool
    No JSON object could be decoded

    If I run this in a hex viewer the issue is revealed:

    $ curl -s | hexdump -C
    00000000  ef bb bf 7b 22 6e 61 6d  65 22 3a 22 5c 75 30 34  |...{"name":"\u04|

    Notice the bytes ef bb bf. These are the UTF-8 BOM (Byte Order Mark):

    It’s probably that you have one of your PHP files like wp-config.php that has been saved with this marker added. You should strip it prevent it from causing the JSON parse error. Your code editor likely has a feature to remove this marker.

    Thank you. Can you add to plugin option to enter a custom short_name? Because truncated name does not convey the essence.

    Plugin Author Weston Ruter


    Yes, all you need to do is add this to your custom theme’s functions.php or a plugin:

    add_filter( 'web_app_manifest', function( $manifest ) {
        $manifest['short_name'] = 'whatever you like';
        return $manifest;
    } );

    Supply the desired short_name there.

    Thank you! I added domain name as short_name.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Second word doesn’t show’ is closed to new replies.