• Resolved pcdokterbreda

    (@pcdokterbreda)


    Hi there,

    I am trying the MGP plugin and am running into a problem. It actually changes the template page with the first values the page is called with.

    I have a template with a city variable used in the title and other places in the page. When I create the template it saves the page with the {{mgp_plaats}} variable. But when the first city page is called it changes the template variable placeholders to that specific city and saves the template. From that point on all pages show the content for the first city since there are no variable placeholders to change.

    I first thought it was a caching issue, but it works the same with caching disabled.

    I run Word Press 5.4.2 with PHP 7.3.

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

Viewing 11 replies - 1 through 11 (of 11 total)
  • @pcdokterbreda

    Hi, do you using a latest version of MPG?

    Thread Starter pcdokterbreda

    (@pcdokterbreda)

    Yes, I just updated the plugin to version 2.1.3 and retested. Same problem.

    @pcdokterbreda Can you attach source file (or link to file) you are using?
    If it’s confidential, you may trim some rows from the end, or send file direct to sanchoclo[ at ].gmail.com

    It’s will help to debug.

    Thread Starter pcdokterbreda

    (@pcdokterbreda)

    Here’s the source from the Code Editor. The theme (Argenta) uses WP Bakery Builder 6.1.

    Title:
    Laptop reparatie {{mpg_plaats}}
    Body:

    [vc_row][vc_column][vc_empty_space][argenta_sc_heading module_type_layout="on_middle" subtitle_type_layout="bottom_subtitle" divider_type="solid" title="Problemen met je laptop in {{mpg_plaats}}?" subtitle_typo="weight~inherit" divider_color="#ef1a1b" subtitle="PC Dokter Breda kan je helpen"][/vc_column][/vc_row][vc_row][vc_column][argenta_sc_text]
    <h1>Goed bereikbaar</h1>
    PC Dokter Breda is gevestigd op <a class="pcdb-red" href="https://www.pcdokterbreda.nl/routebeschrijving/">Minvervum 7444a</a> aan de rand van Breda (nabij de A27) en is goed te bereiken vanuit {{mpg_plaats}}.
    
    Bovendien is het gratis parkeren voor de deur.[/argenta_sc_text][vc_empty_space height="20px"][vc_row_inner][vc_column_inner width="1/4"][/vc_column_inner][vc_column_inner width="1/2"][vc_raw_html]JTNDaWZyYW1lJTIwc3JjJTNEJTIyaHR0cHMlM0ElMkYlMkZ3d3cuZ29vZ2xlLmNvbSUyRm1hcHMlMkZlbWJlZCUzRnBiJTNEJTIxMW0yOCUyMTFtMTIlMjExbTMlMjExZDM5NjM0LjE5NjYxNDU2NjU5NCUyMTJkNC44NTUxMTY3MzM3NDk1OTIlMjEzZDUxLjYyMDY5NDIzMTA3NDI3JTIxMm0zJTIxMWYwJTIxMmYwJTIxM2YwJTIxM20yJTIxMWkxMDI0JTIxMmk3NjglMjE0ZjEzLjElMjE0bTEzJTIxM2UwJTIxNG01JTIxJTdCJTdCbXBnX2dvb2dsZV9tYXBzX2lkJTdEJTdEJTIxNG01JTIxMXMweDQ3YzY5ZjUzNTFhZGQ4ZWYlMjUzQTB4ZDcwMmQ0NjlmMDNjZGJlJTIxMnNNaW5lcnZ1bSUyNTIwNzQ0NEElMjUyQyUyNTIwNDgxNyUyNTIwWkclMjUyMEJyZWRhJTI1MkMlMjUyME5ldGhlcmxhbmRzJTIxM20yJTIxMWQ1MS41ODk3NzkzJTIxMmQ0LjgzNjI5OTElMjE1ZTAlMjEzbTIlMjExc2VuJTIxMnNubCUyMTR2MTU5Mzg2MjkwOTQ2NyUyMTVtMiUyMTFzZW4lMjEyc25sJTIyJTIwd2lkdGglM0QlMjI2MDAlMjIlMjBoZWlnaHQlM0QlMjI0NTAlMjIlMjBmcmFtZWJvcmRlciUzRCUyMjAlMjIlMjBzdHlsZSUzRCUyMmJvcmRlciUzQTAlM0IlMjIlMjBhbGxvd2Z1bGxzY3JlZW4lM0QlMjIlMjIlMjBhcmlhLWhpZGRlbiUzRCUyMmZhbHNlJTIyJTIwdGFiaW5kZXglM0QlMjIwJTIyJTNFJTNDJTJGaWZyYW1lJTNF[/vc_raw_html][/vc_column_inner][vc_column_inner width="1/4"][/vc_column_inner][/vc_row_inner][argenta_sc_text]
    <p style="text-align: center;"><strong>Kijk bij <a class="pcdb-red" href="https://www.pcdokterbreda.nl/routebeschrijving/">routebeschrijving</a> voor details over het openbaar- en eigen vervoer</strong></p>
    [/argenta_sc_text][argenta_sc_text]
    <h1>Eerste contact</h1>
    Door de verschijdenheid aan problemen en oplossingen is het is altijd goed om eerst even contact te hebben. Mogelijk moeten er onderdelen worden besteld met enige levertijd, dus dan is zonde als het apparaat al die tijd hier op de plank ligt.
    
    Neem dus altijd eerst even contact op via <a class="pcdb-red" href="https://wa.me/31768888017"><strong>WhatsApp</strong></a>, <a class="pcdb-red" href="tel:+31768888017"><strong>telefoon (+31 (0) 76 88 88 017)</strong></a>, <a class="pcdb-red" href="mailto:[email protected]"><strong>email</strong></a> of het <a class="pcdb-red" href="https://www.pcdokterbreda.nl/contact/"><strong>contactformulier</strong></a>.[/argenta_sc_text][argenta_sc_text]
    <h1>Werkwijze</h1>
    In de basis wordt de volgende werkwijze gehanteerd, maar uiteraard kan de praktijk hier vanaf wijken als de situatie erom vraagt.
    <ol>
     	<li><strong>Diagnose</strong>: soms is een uitleg en/of een foto genoeg, maar soms hebben we de laptop gelijk nodig voor onderzoek.</li>
     	<li><strong>Prijs</strong>: van de eventuele onderdelen en een inschatting van het werk.</li>
     	<li><strong>Aanbetaling</strong>: het kan zijn dat er om een aanbetaling wordt gevraagd voor de te bestellen onderdelen.</li>
     	<li><strong>Reparatie</strong>: als alle onderdelen binnen zijn, maken we een afspraak voor de reparatie.</li>
     	<li><strong>Ophalen</strong>: bij het ophalen betaal je de eindfactuur met alle onderdelen en werkzaamheden.</li>
    </ol>
    [/argenta_sc_text][argenta_sc_text]
    <h1>Overige informatie</h1>
    <ul>
     	<li><a class="pcdb-red" href="https://www.pcdokterbreda.nl/#pcdb-services-row">Overzicht van mijn diensten</a></li>
     	<li><a class="pcdb-red" href="https://www.pcdokterbreda.nl/#pcdb-pricing-row">Basis tarieven</a></li>
     	<li><a class="pcdb-red" href="https://www.pcdokterbreda.nl/prijslijst/">Lijst met prijzen (indicatie)</a></li>
    </ul>
    [/argenta_sc_text][/vc_column][/vc_row][vc_row][vc_column][vc_empty_space height="60px"][/vc_column][/vc_row]

    @pcdokterbreda Source code is helpful to, but can you send source file?

    I’m talking about .xlsx or .csv.

    Thread Starter pcdokterbreda

    (@pcdokterbreda)

    @lysyiweb I see! I emailed the spreadsheet to your address.

    @pcdokterbreda Source file looks good, but try to use headers in lower case and without spaces, like mpg_google_map_id (just for experiment, I’m not sure that it help)

    But more impact may have this advice:
    add this lines to begin of wp-config.php (located in root folder with WordPress)

    define('DONOTCACHEDB', true);
    define('DONOTCACHEPAGE', true);
    define('DONOTCACHEOBJECT', true);
    Thread Starter pcdokterbreda

    (@pcdokterbreda)

    @lysyiweb aha! Your no cache settings triggered me… I also use Redis Object Cache. Once disabled, the page works fine now.

    I will look into a way to work around this issue for these pages, perhaps you can do the same and test your plugin with Redis Object Cache.

    Redis cache improves page load times, so it would be nice to able to still use it.

    @pcdokterbreda Thank you for feedback.

    You can write condition like:

    add_action( 'pre_get_posts', 'check_is_mpg_page')
    
    function check_is_mpg_page(){
       if($page_id === 'your_template_id' ){
          define('DONOTCACHEOBJECT', true);         
       }
    }

    Aslo, we will research ability to make MPG compatible with Redis Object Cache, thank

    Thread Starter pcdokterbreda

    (@pcdokterbreda)

    @lysyiweb Thank you for your support!

    Where would I place a condition like this?

    @pcdokterbreda In any file, that will not be overwritten after update MPG of WP, for example in file functions.php in your theme folder

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Variables in template set to values for first page called (no cache)’ is closed to new replies.