• Resolved nuric

    (@nuric)


    Hello,

    Could you please check my website. It do not work. and Service work generates error 404.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @nuric,

    Thanks for checking out SuperPWA.

    Can you try adding this code to functions.php of your active theme? Please clear the cache after that and check it out.

    /**
     * Register service worker with cache busting query string.
     * 
     * @link https://github.com/SuperPWA/Super-Progressive-Web-Apps/blob/c3eafd27e207b52e3f1f83de392eeec0ecee1109/public/sw.php#L217-L232
     */
    function superpwa_helper_register_sw() {
    	
    	wp_enqueue_script( 'superpwa-register-sw', SUPERPWA_PATH_SRC . 'public/js/register-sw.js', array(), null, true );
    	wp_localize_script( 'superpwa-register-sw', 'superpwa_sw', array(
    			'url' => parse_url( superpwa_sw( 'src' ), PHP_URL_PATH ) . '/?nocache',
    		)
    	);
    }
    remove_action( 'wp_enqueue_scripts', 'superpwa_register_sw' );
    add_action( 'wp_enqueue_scripts', 'superpwa_helper_register_sw' );

    Looking forward to your feedback.

    Thread Starter nuric

    (@nuric)

    error

    Fatal error: Uncaught Error: Call to undefined function superpwa_sw() in /home/u104032/public_html/bryuki-bez-ryadov.ru/wp-content/themes/porto-child/functions.php:12 Stack trace: #0 /home/u104032/public_html/bryuki-bez-ryadov.ru/wp-includes/class-wp-hook.php(286): superpwa_helper_register_sw(”) #1 /home/u104032/public_html/bryuki-bez-ryadov.ru/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #2 /home/u104032/public_html/bryuki-bez-ryadov.ru/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #3 /home/u104032/public_html/bryuki-bez-ryadov.ru/wp-includes/script-loader.php(1447): do_action(‘wp_enqueue_scri…’) #4 /home/u104032/public_html/bryuki-bez-ryadov.ru/wp-includes/class-wp-hook.php(286): wp_enqueue_scripts(”) #5 /home/u104032/public_html/bryuki-bez-ryadov.ru/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #6 /home/u104032/public_html/bryuki-bez-ryadov.ru/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #7 /home/u104032/public_html/bryuki-bez-ryadov.ru/wp-incl in /home/u104032/public_html/bryuki-bez-ryadov.ru/wp-content/themes/porto-child/functions.php on line 12

    Hello @nuric

    I just noticed that everything works correctly with the latest update.

    🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘do not work’ is closed to new replies.