• Resolved bzadmin

    (@bzadmin)


    Hi, we are using the wp-hide plugin and using the rewrite rules most options (wp-admin, wp-includes, etc)

    The problem we are seeing is that when using the Flatsome theme UXBuilder, their code uses an angular app to display a post to allow for editing. So they bootstrap their own html using the following:

    <!DOCTYPE html>
    <html id="ux-builder" ng-app="uxBuilder" ng-strict-di <?php language_attributes(); ?>>
    <head>
      <title><?php echo $title; ?></title>
      <meta charset="<?php bloginfo( 'charset' ); ?>">
      <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
      <?php wp_print_styles( $ux_builder_styles ) ?>
    </head>

    the effect of wp_print_styles (and later wp_print_scripts) is that the rewrite rules are not applied and the resulting html has 404s all over the place rendering the editor unusable. Any ideas how this could be modified to make it work with the rewrite rules?

    Thanks for the help and for such awesome plugin!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Maya

    (@tdgu)

    Hi,
    Thanks for your feedback.
    I can’t find the mentioned plugin in WordPress repository, this must be a paid code?
    If so i’ll try to get in touch with the developers so they provide a temporary license which i can use and check into the problem.

    As an alternative, for a faster way please get in touch with us.

    Thanks

    Thread Starter bzadmin

    (@bzadmin)

    Hi,
    The theme is in this link:
    https://flatsome3.uxthemes.com/
    a description of their UX Builder is this:
    https://flatsome3.uxthemes.com/features/ux-page-builder/

    But essentially what is happening is this:
    – The theme adds an “app” to edit the post, and it produces a link that ends up looking like this:
    https:/…/backend/post.php?post=79804&action=edit&app=uxbuilder&type=editor&v=3e8d115eb4b3#/

    Where backend is equivalent to wp-admin.

    You can reproduce this by adding this somewhere in a valid function.php of your theme or plugin:

    add_action( 'current_screen', function ( $screen ) {
        if ( $screen->base !== 'post' ) return; // not a post page
        if ( ! array_key_exists( 'apptest', $_GET ) ) return;
        if ( ! array_key_exists( 'type', $_GET ) ) return;
      
        // $post_types = get_ux_builder_post_types();
        // $post = ux_builder( 'editing-post' )->post();
      
        // Render template for registered post types only.
      do_action( 'admin_enqueue_scripts' );
    ?><!DOCTYPE html>
    <html>
    <head>
      <title>Test</title>
      <meta charset="<?php bloginfo( 'charset' ); ?>">
      <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
      <?php wp_print_styles( ) ?>
    </head>
    <body>  
      <?php wp_print_scripts(  ) ?>
    </body>
    </html>
    
    <?php    
    
      
          die;
      } );

    and call it with the following url
    /backend/post.php?post=79804&action=edit&apptest=uxbuilder&type=editor#/

    where the post id is valid, and backend is the string you use to substitute wp-admin

    the result should be looking something like this:

    <html><head><style></style></head><body>
      <title>Test</title>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
      <style type="text/css">
    
    </style>
    	<link rel="stylesheet" id="dashicons-css" href="https://dev-server/wp-includes/css/dashicons.min.css?ver=5.3.2" media="all">
    <link rel="stylesheet" id="admin-bar-css" href="https://dev-server/wp-includes/css/admin-bar.min.css?ver=5.3.2" media="all">
    <link rel="stylesheet" id="query-monitor-css" href="https://dev-server/wp-content/plugins/query-monitor/assets/query-monitor.css?ver=1575950207" media="all">
    <link rel="stylesheet" id="wp-auth-check-css" href="https://dev-server/wp-includes/css/wp-auth-check.min.css?ver=5.3.2" media="all">
    <link rel="stylesheet" id="wp-block-library-css" href="https://dev-server/wp-includes/css/dist/block-library/style.min.css?ver=5.3.2" media="all">
    <link rel="stylesheet" id="wc-block-style-css" href="https://dev-server/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/style.css?ver=2.5.11" media="all">
    <link rel="stylesheet" id="wp-components-css" href="https://dev-server/wp-includes/css/dist/components/style.min.css?ver=5.3.2" media="all">
    <link rel="stylesheet" id="wp-editor-font-css" href="https://fonts.googleapis.com/css?family=Noto+Serif%3A400%2C400i%2C700%2C700i&ver=5.3.2" media="all">
    <link rel="stylesheet" id="wp-block-editor-css" href="https://dev-server/wp-includes/css/dist/block-editor/style.min.css?ver=5.3.2" media="all">
    <link rel="stylesheet" id="wp-nux-css" href="https://dev-server/wp-includes/css/dist/nux/style.min.css?ver=5.3.2" media="all">
    <link rel="stylesheet" id="wp-editor-css" href="https://dev-server/wp-includes/css/dist/editor/style.min.css?ver=5.3.2" media="all">
    <link rel="stylesheet" id="wp-block-library-theme-css" href="https://dev-server/wp-includes/css/dist/block-library/theme.min.css?ver=5.3.2" media="all">
    <link rel="stylesheet" id="wp-edit-blocks-css" href="https://dev-server/wp-includes/css/dist/block-library/editor.min.css?ver=5.3.2" media="all">
    <link rel="stylesheet" id="wc-block-editor-css" href="https://dev-server/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/editor.css?ver=2.5.11" media="all">
    <link rel="stylesheet" id="flatsome-gutenberg-css" href="https://dev-server/wp-content/themes/flatsome/inc/admin/gutenberg/assets/css/style.css?ver=1.0.1" media="all">
    <link rel="stylesheet" id="ux_shortcode_insert_css-css" href="https://dev-server/wp-content/themes/flatsome/inc/extensions/flatsome-shortcode-insert/style.css?ver=5.3.2" media="all">
    <link rel="stylesheet" id="flatsome-panel-css-css" href="https://dev-server/wp-content/themes/flatsome/inc/admin/panel/panel.css?ver=5.3.2" media="all">
    <link rel="stylesheet" id="custom-css-css" href="https://dev-server/wp-content/plugins/custom-template/custom/admin.css" media="all">
    
      
      <script src="https://dev-server/wp-includes/js/jquery/jquery.js?ver=1.12.4-wp"></script>
    <script src="https://dev-server/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1"></script>
    <script src="https://dev-server/wp-includes/js/jquery/ui/core.min.js?ver=1.11.4"></script>
    <script src="https://dev-server/wp-includes/js/jquery/ui/widget.min.js?ver=1.11.4"></script>
    <script src="https://dev-server/wp-includes/js/jquery/ui/mouse.min.js?ver=1.11.4"></script>
    <script src="https://dev-server/wp-includes/js/jquery/ui/sortable.min.js?ver=1.11.4"></script>
    <script src="https://dev-server/wp-includes/js/hoverIntent.min.js?ver=1.8.1"></script>
    <script src="https://dev-server/wp-includes/js/utils.min.js?ver=5.3.2"></script>
    <script src="https://dev-server/wp-admin/js/common.min.js?ver=5.3.2"></script>
    <script src="https://dev-server/wp-includes/js/hoverintent-js.min.js?ver=2.2.1"></script>
    <script src="https://dev-server/wp-includes/js/admin-bar.min.js?ver=5.3.2"></script>
    <script src="https://dev-server/wp-includes/js/dist/vendor/wp-polyfill.min.js?ver=7.4.4"></script>
    <script src="https://dev-server/wp-includes/js/dist/hooks.min.js?ver=2.6.0"></script>
    

    as you can see wp-includes, wp-admin etc are not being re-written by wp-hide.

    Thanks!

    Thread Starter bzadmin

    (@bzadmin)

    Any ideas of how to solve this? The previous message contains a repro. Thanks

    Plugin Contributor Maya

    (@tdgu)

    Thanks again for your feedback. The issue should be fixed in the latest plugin version.

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

The topic ‘Flatsome UXBuilder wp_print_styles problem’ is closed to new replies.