Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • superkaratemonkeydeathcar

    (@superkaratemonkeydeathcar)

    Great stuff @errorsys!

    I also checked it with a PHP7 Compatibility Plugin and this was the output:

    FILE: /home/mysite/public_html/wp-content/plugins/db-cache-reloaded-fix/db-functions.php
    ———————————————————————————————
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ———————————————————————————————
    54 | WARNING | Use of deprecated PHP4 style class constructor is not supported since PHP 7.
    ———————————————————————————————

    FILE: /home/mysite/public_html/wp-content/plugins/db-cache-reloaded-fix/db-module.php
    —————————————————————————————————————-
    FOUND 9 ERRORS AFFECTING 9 LINES
    —————————————————————————————————————-
    214 | ERROR | Assigning the return value of new by reference is deprecated in PHP 5.3 and forbidden in PHP 7.0
    411 | ERROR | Extension ‘mysql_’ is deprecated since PHP 5.5 and removed since PHP 7.0; Use mysqli instead
    421 | ERROR | Extension ‘mysql_’ is deprecated since PHP 5.5 and removed since PHP 7.0; Use mysqli instead
    427 | ERROR | Extension ‘mysql_’ is deprecated since PHP 5.5 and removed since PHP 7.0; Use mysqli instead
    430 | ERROR | Extension ‘mysql_’ is deprecated since PHP 5.5 and removed since PHP 7.0; Use mysqli instead
    440 | ERROR | Extension ‘mysql_’ is deprecated since PHP 5.5 and removed since PHP 7.0; Use mysqli instead
    441 | ERROR | Extension ‘mysql_’ is deprecated since PHP 5.5 and removed since PHP 7.0; Use mysqli instead
    445 | ERROR | Extension ‘mysql_’ is deprecated since PHP 5.5 and removed since PHP 7.0; Use mysqli instead
    450 | ERROR | Extension ‘mysql_’ is deprecated since PHP 5.5 and removed since PHP 7.0; Use mysqli instead
    —————————————————————————————————————-

    FILE: /home/mysite/public_html/wp-content/plugins/db-cache-reloaded-fix/db-cache-reloaded.php
    —————————————————————————————————————–
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    —————————————————————————————————————–
    73 | WARNING | Use of deprecated PHP4 style class constructor is not supported since PHP 7.
    91 | ERROR | Assigning the return value of new by reference is deprecated in PHP 5.3 and forbidden in PHP 7.0
    —————————————————————————————————————–

    FILE: /home/mysite/public_html/wp-content/plugins/db-cache-reloaded-fix/db-module-wrapper.php
    —————————————————————————————————————-
    FOUND 1 ERROR AFFECTING 1 LINE
    —————————————————————————————————————-
    105 | ERROR | Assigning the return value of new by reference is deprecated in PHP 5.3 and forbidden in PHP 7.0
    —————————————————————————————————————-

    I wonder that if for people who know PHP a little better than I do, these could all be easy fixes?

    superkaratemonkeydeathcar

    (@superkaratemonkeydeathcar)

    Hi Eric,
    I was having the same issue myself.

    So I poked around in the plugin files, found a solution & thought I’d share.

    Beforehand though,
    NOTE: This type of Trial+Error also works best if you have a little separate testing-area install of WP on a subdirectory of your server like /newfeaturetests/ or whatever.
    -So you don’t screw an important live-site horking around with your core php files, by making some little syntactical or punctuation mistake.
    Just fill it with dummy headers, entries, images, etc. and fool around with no/low consequences.

    Anyway,

    If you go into Plugins>Editor, and look in the files:
    add-meta-tags/metadata/amt_twitter_cards.php
    add-meta-tags/metadata/amt_opengraph.php,

    On Line 510 of the OpenGraph one you should see:
    $size='medium'
    Change medium to the image size that you would like. In mine, I just put full, because mine aren’t that big.
    Also, Put a note in the nearest comment area of the php file that you changed something to remind yourself what, when & where.
    Save the changes with “Update File”.

    In the file for the Twitter Cards its on Line 137.

    I haven’t looked in the Schema one, but a search for the word, ‘medium’ and then a change to your desired size should give similar results. (upd: It might be the one on Line 410)

    Do the same thing, super-reload the page & see what happens.

    Best of Luck; Cheers.

    Thread Starter superkaratemonkeydeathcar

    (@superkaratemonkeydeathcar)

    Wow! Nice detective work, there.

    ” what’s that doing there? It doesn’t contain anything.” -hah! My thoughts, too.

    Thanks very much for the reply!

    Thread Starter superkaratemonkeydeathcar

    (@superkaratemonkeydeathcar)

    Ok, for those who want to give this a shot, I figured it out with my non-existant PHP skills.

    Ok, so back near 399 of featured-posts-grid.php, after

    global $post;
    $temp_post = $post;

    I just made a function, where I could pass the $val->post_title and a limit as arguments.

    So, it goes:

    function limit_chars ($string, $limit) {
    			if (strlen($string) > $limit) {
    				$text = substr($string,0,strpos($string,' ',$limit)); }
    			else $text = $string;
    			$text = $text . ' ...';
    			return ($text);
    }

    Then in the next block, where it pulls down all the elements of each post it throws, right after the call:

    foreach ( $recent_posts as $key=>$val )
        {
            setup_postdata($val);

    I pull up my little character+word-break+… limiter with this:
    $post_details[$key]['post_title'] = limit_chars($val->post_title, 45);

    -And then let the blocks for excerpt, author, etc. run normally.

    Took awhile, but I just tested it now and it seems to run great! ::knock on wood::

    So, there you are. If anyone else needs it, it appears to work.

    Cheers!

    Thread Starter superkaratemonkeydeathcar

    (@superkaratemonkeydeathcar)

    I went out and found user Alchemyth’s help in this thread: https://www.ads-software.com/support/topic/limit-excerpt-length?replies=11

    But I don’t really know enough PHP to make it work properly. I know I’m doing something wrong, but am having trouble figuring it out.

    So far, from Line 403 of featured-posts-grid.php, I have:
    <code>
    $post_details[$key][‘post_title’] = $text;
    $text = $val->post_title;
    if (strlen($text) > 50) {
    $text = substr($text,0,strpos($text,’ ‘,50)); }
    else $text = $val->post_title;
    $text = $text . ‘ …’;
    `

    -But this doesn’t work.
    It skips the first of my 5 thumbnails across (only 1 row), and then starts putting the titles of entries 1-4 into images 2-5.

    Any code help would be appreciated.

    (that bit up there is Alchemyth’s trick to limit the length, chop off the last broken word and add an ellipsis, ie: …)

    Thanks for any help!

    Thread Starter superkaratemonkeydeathcar

    (@superkaratemonkeydeathcar)

    Ok, great!

    Thank you very much for the time, effort and info! +I’ll give that one a look.

    Cheers,
    skmdc

    Thread Starter superkaratemonkeydeathcar

    (@superkaratemonkeydeathcar)

    bump!
    Any ideas?

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