Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • Seems pretty dumb not to have it on login page tbh…..

    Great that somebody actually tests their releases before they break stuff…

    Anyway this is the error:
    Notice: Undefined variable: wp_query in /wp-content/plugins/theme-my-login/includes/class-theme-my-login.php on line 264

    Fatal error: Uncaught Error: Call to a member function is_main_query() on Null

    TO FIX THIS IS EASY:

    This is a typo in class-theme-my-login.php file the variable should be $query not $wp_query….

    open file: theme-my-login/includes/class-theme-my-login.php
    go to line 264…

    edit:
    // Bail if not the main query
    if ( ! $wp_query->is_main_query() )
    return;

    change to:

    // Bail if not the main query
    if ( ! $query->is_main_query() )
    return;

    • This reply was modified 9 years, 3 months ago by marketsys.
    • This reply was modified 9 years, 3 months ago by marketsys.

    I had similar problems, i found my issue is that i had manually added some script tags to header and inline script eg

    <script type=”text/javascript” src=”….” />

    Make sure you remove any you have added like that and use the dedicated wordpress method of wp_enqueue_script in your functions.php(and same for css use wp_enqueue_style)

    using this method there is a way to specify the load order so i just specify them to be loaded after jquery and then the minification and javascript functionality worked as intended with w3 total cache as everything was done in the right order

    eg:

    wp_enqueue_script( ‘mytheme-bootstrap-js’, $dir . ‘/js/bootstrap.js’, array( ‘jquery’ ), null, true );

    • This reply was modified 9 years, 3 months ago by marketsys.

    I found the answer, if anybody needs it. There is error in template file:

    yti_v/new_video.php

    The input text field name in this template is cbc_video_id,
    this should be yvi_video_id. New F** up whoever wrote this plugin and didnt bother to fix.

    Anyway edit the template so
    <input type=”text” name=”cbc_video_id” value=”” />

    becomes:

    <input type=”text” name=”yvi_video_id” value=”” />

    Save and everything will be fine 😀

    TBH the way this schedules single cron events for each expire is plain awful, you are correct it doesnt work on a vanilla 4.6 install either. Anyway I will rewrite the cron routine myself as its garbage coding…

    Also means if you programmatically insert posts with wp_insert_post then set post_meta _expiration-date, _expiration-date-options and _expiration-date-status

    it does not schedule the cron event so nothing will happen even though the date is saved and shows ok in edit post screen..

    So you need to call _scheduleExpiratorEvent($id,$ts,$opts) rather than set post_meta

    But that isn’t a solution for me anyway as I would have 5000+ cron event scheduled in no time at all.

    I wish people that write modules for wordpress would appreciate there are sites that are much larger than a few pages.

    Guess you didn’t bother to check or fix cos this screwed my css minification up, I found the reason is this wpa.css (in styles/0/wpa.css, styles/1/wpa.css, styles/2/wpa.css etc) You have in file:

    NOTE AT THE VERY END OF EACH IS ‘; with breaks stylesheets when compressed or minified

    ul.post-attachments{list-style:none;margin:0;}
    li.post-attachment{background:url(document.png) 0 4px no-repeat;padding-left:24px;}
    .post-attachment.mime-imagejpeg,.post-attachment.mime-imagepng,.post-attachment.mime-imagejpeg,.post-attachment.mime-imagegif{background-image:url(document-image.png);}
    .post-attachment.mime-applicationzip{background-image:url(document-zipper.png);}
    .post-attachment.mime-applicationpdf{background-image:url(document-pdf.png);}
    .post-attachment.mime-applicationvnd-ms-excel{background-image:url(document-excel.png);}
    .post-attachment.mime-applicationvnd-openxmlformats-officedocument-spreadsheetml-sheet{background-image:url(document-excel.png);}
    .post-attachment.mime-applicationmsword{background-image:url(document-word.png);}
    .post-attachment.mime-applicationvnd-openxmlformats-officedocument-wordprocessingml-document{background-image:url(document-word.png);}
    .post-attachment.mime-applicationvnd-oasis-opendocument-spreadsheet{background-image:url(document-ods.png);}
    .post-attachment.mime-applicationvnd-oasis-opendocument-text{background-image:url(document-odt.png);}
    .post-attachment.mime-audiompeg{background-image:url(document-music.png);}’;

    Thread Starter marketsys

    (@marketsys)

    Actually I have stopped much of the mysql issues if I set a limit for searches of about 100 and add a load of mysql indexes on the relevanssi tables in wordpress. You should have indexes for those tables by default to make it faster to find the right data, I have tens of millions of records in wp_relevanssi for example. I guess combined with object caching and query caching etc it is ok now. It still runs a little high when there are many searches at once but is useable at the moment without breaking mysql. I used this plugin to begin with because I wanted something to custom weight pages based on type and divide my search results into categories so a few categories would show first, which actually works well and exactly how I want it to with my custom functions in functions.php. I mean as it is now it would actually work ok but searches take a few seconds to load page so will probably migrate over to Apache Solr instead which I already have installed on my server but never got around to looking into it and working it out properly

    Thread Starter marketsys

    (@marketsys)

    I think I find the answer in that developer does not recommend use on high traffic large database sites…. yes because you wrote it in bad way that absolutely cains db access. I have 250000 posts and this is a fail.. ok I will delete this is v bad

    Thread Starter marketsys

    (@marketsys)

    ok query works it just cut off some end brackets in log, however mysql is getting hammered what is solution

    Thread Starter marketsys

    (@marketsys)

    when i run the above query manually I get: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1

    I recently upgraded my database server from 5.1 to 5.5 mysql does that have anything to do with it

    Thread Starter marketsys

    (@marketsys)

    better off using the full if statement like:

    if (function_exists(‘http_response_code’) && in_array(http_response_code(),array(301,302)) ){
    return false;
    }

    as http_response_code function only exists in php > 5.4

    Thread Starter marketsys

    (@marketsys)

    ok, turns out I pasted the patch wrongly inside another if statement so it does work and 301/302 is no longer cached..

    should be in function _can_cache2 :

    function _can_cache2(&$buffer) {
    /**
    * Skip if caching is disabled
    */
    if (!$this->_caching) {
    return false;
    }

    /**
    * Check for database error
    */
    if (w3_is_database_error($buffer)) {
    $this->cache_reject_reason = ‘Database error occurred’;

    return false;
    }

    /**
    * Check for DONOTCACHEPAGE constant
    */
    if (defined(‘DONOTCACHEPAGE’) && DONOTCACHEPAGE) {
    $this->cache_reject_reason = ‘DONOTCACHEPAGE constant is defined’;

    return false;
    }

    /**
    * Check hostname
    */
    if ((!w3_is_multisite() || (w3_is_multisite() && !w3_force_master())) &&
    $this->_config->get_boolean(‘pgcache.check.domain’) && w3_get_host() != w3_get_home_domain()) {
    $this->cache_reject_reason = ‘Hostname mismatch’;

    return false;
    }

    /**
    * Don’t cache 404 pages
    */
    if (!$this->_config->get_boolean(‘pgcache.cache.404’) && function_exists(‘is_404’) && is_404()) {
    $this->cache_reject_reason = ‘Page is 404’;

    return false;
    }

    /**
    * Don’t cache homepage
    */
    if (!$this->_config->get_boolean(‘pgcache.cache.home’) && function_exists(‘is_home’) && is_home()) {
    $this->cache_reject_reason = is_front_page() && is_home() ? ‘Page is front page’ : ‘Page is posts page’;

    return false;
    }

    /**
    * Don’t cache front page
    */
    if ($this->_config->get_boolean(‘pgcache.reject.front_page’) && function_exists(‘is_front_page’) && is_front_page() && !is_home()) {
    $this->cache_reject_reason = ‘Page is front page’;

    return false;
    }

    /**
    * Don’t cache feed
    */
    if (!$this->_config->get_boolean(‘pgcache.cache.feed’) && function_exists(‘is_feed’) && is_feed()) {
    $this->cache_reject_reason = ‘Page is feed’;

    return false;
    }

    /**
    * Check if page contains dynamic tags
    */
    if ($this->_enhanced_mode && $this->_has_dynamic($buffer)) {
    $this->cache_reject_reason = ‘Page contains dynamic tags (mfunc or mclude) can not be cached in enhanced mode’;
    return false;
    }

    /**
    * Don’t cache redirects (301,302)
    */
    if (in_array(http_response_code(),array(301,302)) ){
    return false;
    }

    return true;
    }

    Thread Starter marketsys

    (@marketsys)

    301s from wordpress core canonical redirects are cached as blank pages

    eg

    http://www.sitename.com/category1/a_page_name

    canonical redirect goes to

    http://www.sitename.com/section/category1/a_page_name

    on first access http://www.sitename.com/category1/a_page_name redirects to
    http://www.sitename.com/section/category1/a_page_name and displays page

    on subsequent access http://www.sitename.com/category1/a_page_name returns cache page (blank page)
    on subsequent access http://www.sitename.com/category1/a_page_name returns correctly cached page.

    If turn off canonical redirect in core with remove_filter(‘template_redirect’, ‘redirect_canonical’);

    both urls are cached correctly (however 1 is obviously a duplicate and unncessary)

    Need to get this plugin to ignore the 301 pages in cache but patch linked above isn’t working

    Thread Starter marketsys

    (@marketsys)

    OK, actually I can see I actually have no rewrite rule for post_part……..just post.xml, you need to update your rules/instructions for multi page sitemaps

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