• Resolved Kevin Gobert

    (@kevinkoalect)


    Hello,
    We encounter a blank page when we want to edit a specific page. The error apparently comes from the plugin.

    Here is the error:

    [2024-06-14 09:20:02] production.ERROR: preg_match_all(): Unknown modifier '0' {"userId":null,"email":null,"exception":"[object] (ErrorException(code: 0): preg_match_all(): Unknown modifier '0' at /home/<name>/public_html/<folder>/content/plugins/wp-seopress/src/Services/ContentAnalysis/GetContent.php:22)
    [stacktrace]
    #0 [internal function]: Themosis\\Core\\Bootstrap\\ExceptionHandler->handleError(2, 'preg_match_all(...', '/home/<name>...', 22, Array)
    #1 /home/<name>/public_html/<folder>/content/plugins/wp-seopress/src/Services/ContentAnalysis/GetContent.php(22): preg_match_all('#\\\\b(mecenat d&#...', 'https://www.pro...', Array)
    #2 /home/<name>/public_html/<folder>/content/plugins/wp-seopress/src/Services/ContentAnalysis/GetContent.php(106): SEOPress\\Services\\ContentAnalysis\\GetContent->getMatches('https://www.pro...', Array)
    #3 /home/<name>/public_html/<folder>/content/plugins/wp-seopress/src/Services/ContentAnalysis/GetContent.php(905): SEOPress\\Services\\ContentAnalysis\\GetContent->analyzeKeywordsPermalink(Array, Array, Object(WP_Post))
    #4 /home/<name>/public_html/<folder>/content/plugins/wp-seopress/inc/admin/metaboxes/admin-metaboxes-content-analysis-form.php(85): SEOPress\\Services\\ContentAnalysis\\GetContent->getAnalyzes(Object(WP_Post))
    #5 /home/<name>/public_html/<folder>/content/plugins/wp-seopress/inc/admin/metaboxes/admin-metaboxes.php(550): require_once('/home/<name>...')
    #6 /home/<name>/public_html/<folder>/cms/wp-admin/includes/template.php(1456): seopress_content_analysis(Object(WP_Post), Array)
    #7 /home/<name>/public_html/<folder>/cms/wp-admin/includes/post.php(2383): do_meta_boxes(Object(WP_Screen), 'normal', Object(WP_Post))
    #8 /home/<name>/public_html/<folder>/cms/wp-admin/edit-form-blocks.php(316): the_block_editor_meta_boxes()
    #9 /home/<name>/public_html/<folder>/cms/wp-admin/post.php(187): require('/home/<name>...')
    #10 {main}
    "}

    Can you help me ?
    THANKS

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Benjamin Denis

    (@rainbowgeek)

    Hi,

    which version of SEOPress and WP do you have?

    What’s the target keyword entered for this page please?

    Thanks

    Thread Starter Kevin Gobert

    (@kevinkoalect)

    Hi,

    Thank for your answer. Yes sorry I forgot to mention the infos.

    WP version: 6.5.4
    Plugin version: 7.8
    _seopress_analysis_target_kw: Prométhéa,culture,patrimoine,entreprises,mécénat d’entreprise,mécènes,réseau,conseil d’administration,actions,former,connecter,sensibiliser,valorisation,promotion

    I tried to remove the keyword via the database but it doesn’t fix my issue.

    Thanks

    Thread Starter Kevin Gobert

    (@kevinkoalect)

    Hi Benjamin,

    Do you have news about the issue? I saw an update and it doesn’t fix my issue?

    Thanks

    Plugin Author Benjamin Denis

    (@rainbowgeek)

    Hi,

    we are not able to reproduce the issue on our side.

    Can you list the active theme and plugins please?

    Which version of PHP, WordPress do you use?

    Thanks

    Thread Starter Kevin Gobert

    (@kevinkoalect)

    Hi,

    I put some logs to understand what is happening.

    I think I found the issue. The client put a ' in his keywords.

    preg_match_all('#\b(mecenat d'entreprise)\b#iu', '.../notre mission/'

    When I tried to remove wrong keywords but they stay in the analyse.

    https://www.dropbox.com/s/291ccr1vweh809v/Screenshot%202024-06-24%20at%2009.56.44.png?e=2&dl=0

    [24-Jun-2024 07:55:52 UTC] https://test.local/fr/a propos/notre mission/
    [24-Jun-2024 07:55:52 UTC] #\b(promethea)\b#iu
    [24-Jun-2024 07:55:52 UTC] #\b(culture)\b#iu
    [24-Jun-2024 07:55:52 UTC] #\b(patrimoine)\b#iu
    [24-Jun-2024 07:55:52 UTC] #\b(entreprises)\b#iu
    [24-Jun-2024 07:55:52 UTC] #\b(mecenat d'entreprise)\b#iu
    [24-Jun-2024 07:55:52 UTC] #\b(mecenes)\b#iu
    [24-Jun-2024 07:55:52 UTC] #\b(reseau)\b#iu
    [24-Jun-2024 07:55:52 UTC] #\b(conseil d'administration)\b#iu
    [24-Jun-2024 07:55:52 UTC] #\b(actions)\b#iu
    [24-Jun-2024 07:55:52 UTC] #\b(former)\b#iu
    [24-Jun-2024 07:55:52 UTC] #\b(connecter)\b#iu
    [24-Jun-2024 07:55:52 UTC] #\b(sensibiliser)\b#iu
    [24-Jun-2024 07:55:52 UTC] #\b(valorisation)\b#iu
    [24-Jun-2024 07:55:52 UTC] #\b(promotion)\b#iu
    Thread Starter Kevin Gobert

    (@kevinkoalect)

    This code fix the issue:

    GetContent.php:21

    $kw = remove_accents(htmlspecialchars_decode($kw, ENT_QUOTES));
    foreach ($targetKeywords as $kw) {
    $kw = remove_accents(htmlspecialchars_decode($kw, ENT_QUOTES));

    if (preg_match_all('#\b(' . $kw . ')\b#iu', remove_accents($content), $m)) {
    $data[$kw] = $m[0];
    }
    }
    Plugin Author Benjamin Denis

    (@rainbowgeek)

    Can you go to your database with PhpMyAdmin (or equivalent), and open the wp_postmeta table.

    Search this meta_key = _seopress_analysis_target_kw

    And enter the ID of your post ID in post_id

    Paste the result here please.

    Thread Starter Kevin Gobert

    (@kevinkoalect)

    Hi,

    Here the result:

    Prométhéa,culture,patrimoine,entreprises,mécénat d'entreprise,mécènes,réseau,conseil d'administration,actions,former,connecter,sensibiliser,valorisation,promotion

    “mécénat d’entreprise” becomes “mecenat d& #39;entreprise”

    • This reply was modified 8 months, 4 weeks ago by Kevin Gobert.
    Plugin Author Benjamin Denis

    (@rainbowgeek)

    Hi,

    thank you for your patience.

    We have been able to reproduce the issue.

    We are working on a fix.

    May I know your PHP version used please?

    Thread Starter Kevin Gobert

    (@kevinkoalect)

    Hi Benjamin,

    Ok super.

    For this website, we use PHP 7.4.3

    Thanks

    Plugin Author Benjamin Denis

    (@rainbowgeek)

    OK.

    Try to replace in these 2 files:

    src/Services/ContentAnalysis/GetContent.php

    src/Services/ContentAnalysis/DomAnalysis.php

    The code around line 22 / 13 by this one:

    $kw = remove_accents(wp_specialchars_decode($kw));
    if (preg_match_all('#\b(' . preg_quote($kw, '/') . ')\b#iu', remove_accents($content), $m)) {
    $data[$kw] = $m[0];
    }
    Thread Starter Kevin Gobert

    (@kevinkoalect)

    It seems to work.

    Thanks a lot

    Plugin Author Benjamin Denis

    (@rainbowgeek)

    Perfect!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Admin metabox crash’ is closed to new replies.