Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    I had the same problem when changing from PHP7.2 to 7.4. In PHP 7.3 the Perl Compatible Regular Expressions (PCRE) engine was migrated to PCRE2.
    https://php.watch/versions/7.3/pcre2

    This has impacted the interpretation of regex patterns used by PHPSimpleHTMLDOM. Fortunately, it seems to just impact the escaping of hyphens, which is evidently addressed by the newer version of the parser, as @tremlas says. But actually, the supplied version, 1.5, can be fixed by simply inserting ‘\’ before instances of ‘-’ in two lines of simple_html_dom.php:

    l.696 (4 insertions) becomes:

    $pattern = "/([\w\-:\*]*)(?:\#([\w\-]+)|\.([\w\-]+))?(?:\[@?(!?[\w\-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";

    l. 1378 (1 insertion) becomes:

    if (!preg_match("/^[\w\-:]+$/", $tag)) {

    That seemed to enable the plugin to work again in my case.

    I had similar problems crop up with a local setup (Apache httpd serving on localhost), whereas previously it was creating full output fine: when running ‘Generate’ it would output 7 files, including just one page (the home page) plus a few other files. No errors reported in the Export Log, but it should have output over 100 pages. I also got the 301 response in the Diagnostics.

    Looking at Apache’s error log, I saw a reference to the Simple HTML DOM parser library during the cron job that scans the pages. A sample error:

    [Tue Jan 01 20:35:31.065632 2019] [php7:warn] [pid 264] [client ::1:58291] PHP Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /Library/WebServer/Documents/wordpress/wp-content/plugins/simply-static/includes/libraries/PhpSimple/simplehtmldom_1_5/simple_html_dom.php on line 1378, referer: ...

    I was running PHP 7.3 and the problem disappeared when I switched to an earlier version of PHP.

    Perhaps it’s related to the problem reported here:
    https://www.ads-software.com/support/topic/php-fatal-error-uncaught-error-call-to-a-member-function-children-on-array/ ?

    – Paul

    Yes, an image can also be included on the ‘reveal’ side.

    1. When adding an image, in the text box just add the HTML for displaying an image, like:

      <img src="/wp-content/uploads/image_back.jpg" />

    2. Add a new CSS class to your theme (e.g. find where additional CSS can be included in the customisation of its appearance). This is mainly to ensure that images are visible.
      /* Flipping cards support for two images (front and back) */
      
      div.whiteflip div.flipping-card-image:hover h2 {
              transform: rotateY(0deg);
      }
      
      div.whiteflip div.flipping-card-image {
              float: left;
              position: relative;
              background: #333;
      }
      
      div.whiteflip div.flipping-card-image img {
          backface-visibility: visible;
          transform: rotateY(0deg);
      }
      
      div.whiteflip div.flipping-card-image h2 {
          padding:0;
          width: 100%;
          height: 100%;
      }
    3. In the page/post (HTML source view) wrap the shortcode in a <div> tag:
      <div class="whiteflip">
       [flipping-card id=1]
      </div>

    I did this for some larger images as part of an online exhibition:
    https://www.mhs.ox.ac.uk/backfromthedead/exhibition/myth-busting/

    (Ideally I should make these images more responsive.)

    (Please excuse any poor formatting – this is my first post ??

    I was also hit by this problem of disappearing ‘top pages’ etc. I think a solution is a small edit to the script to remove the page ID and then successively each parent page ID from the list of exclusions.

    The following seems to work for me:

    (In flexi-pages-widget.php 1.6.3) where you have lines 291-4:

    if($exinclude == 'include')
            $include = $exinclude_values;
        else
            $exclude = $exinclude_values;

    replace line 294 with:

    {
            $exclude = $exinclude_values;
            $exclude_elts = explode(",", $exclude);
            $hierarchy=flexipages_get_currpage_hierarchy();
    	foreach ($hierarchy as $inc_page_id)
         	   {
               $exclude_elts=array_diff($exclude_elts,array($inc_page_id));
               }
           $exclude=implode(",",$exclude_elts);
        }

    Hopefully menus will reappear. If signs are promising, then all being well Srini G will be able to release an updated version.

    – Paul

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