Forum Replies Created

Viewing 15 replies - 16 through 30 (of 78 total)
  • Thread Starter normadize

    (@normadize)

    In my last message I said that I did unset all singular caps (i.e. none of them are granted to any roles) and the notices are still there.

    Also, although I appreciate your input, I’m still not 100% sure about what you mean by “remove singular caps”. Do you mean to delete the singular caps completely?

    If yes, that would contradict the WP docs that I posted previously which show that singular caps should be created but generally not granted to users or roles.

    If no, then I already said that none of the singular caps are granted to any roles or users and the notices are still there.

    Thread Starter normadize

    (@normadize)

    I unchecked all the checkboxes for singular caps from all the roles and all the Notices are still there.

    The URE plugin is the only piece of code in my setup that trigger these notices; the call stack I attached a few posts above shows that. It might not be at fault per-se; I’m still confused regarding the singular caps. See my question above.

    Thread Starter normadize

    (@normadize)

    “would generally not” is hardly a well defined rule … what is that even supposed to mean? Sounds like there are exceptions but nothing definite is said (the word “generally” predominates).

    My question still stands: are singular caps deprecated? Do I need to create them at all?

    You asked whether I see “edit_post” in WP core caps as set … I actually don’t see it at all, it’s nonexistent in the list shown by your plugin.

    Thread Starter normadize

    (@normadize)

    Not sure whether you got a bit defensive regarding singular caps, but I created the caps using the available WordPress documentation:

    http://codex.wordpress.org/Function_Reference/register_post_type

    ( see “capabilities” section, around mid-page )

    which, as you can see, clearly shows singular caps of the kind “edit_post”, “read_post” etc. My setup has been working fine without any problems for months, except the notices triggered by your plugin.

    Are you saying that the above documentation from WordPress is wrong and that singular caps are now deprecated? (wouldn’t be the first time that the WP docs are wrong or out of date, I actually think they are the worst docs I’ve ever encountered as a dev)

    Thread Starter normadize

    (@normadize)

    I’d love to help further but I can’t quite offer you the DB.= as it has sensitive data. I posted above full call stacks from Xdebug (in case you missed those).

    You may try to reproduce it by creating a few new roles and a few new caps. Various subsets of the new caps (mostly overlapping) are assigned to the new roles but also to the core WP roles. Create users that have a single role equal to one of the new roles which has new caps as well.

    In my case, those users which cause these notices have these equivalent roles and caps:

    Role:
    Customer

    Core caps:
    read

    Custom caps:
    edit_products
    do_review
    read_private_products
    read_private_reviews

    Hope you’ll be able to figure it out. I can try to help with testing or provide more info if you wish.

    Thread Starter normadize

    (@normadize)

    I confirm that the notices are there even without Xdebug. I just checked on a different server that does not have Xdebug installed.

    Xdebug is nice as it shows the full call stack for the notice. Vanilla PHP only shows the final notice.

    Here are all the notices with full call stacks straight from the URE capabilities page (copy/pasted the html code):
    https://dl.dropboxusercontent.com/u/884148/xdebug.html

    And the same ones for the other server without Xdebug:
    https://dl.dropboxusercontent.com/u/884148/vanilla.html

    Just open those html files in a browser (they lack a doctype and head but Firefox and Chrome display them just fine).

    Thread Starter normadize

    (@normadize)

    Hi Vladimir,

    Well, I defined new roles and new capabilities.=, but I wouldn’t call that special. The notices do not appear in the core User Role Editor settings, but only when clicking the “Capabilities” link under a specific user.

    They are all in the “Custom capabilities” section of checkboxes in the screen. The “Core capabilities” checkboxes are all fine.

    They might be Xdebug notices, but I guess you most probably use a debugger too while developing. I’ll check that and report back.

    For now, the URE files and lines are:

    ../class-ure-lib.php:973
    ../ure-user-edit.php:119
    ../class-ure-lib.php:180
    ../class-ure-lib.php:87
    ../class-user-role-editor.php:382

    In total I have 48 of these notices.

    Thread Starter normadize

    (@normadize)

    3.5.2 had only security updates and “updating” qTranslate for 3.5.2 meant just changing define('QT_SUPPORTED_WP_VERSION', '3.5.1'); to define('QT_SUPPORTED_WP_VERSION', '3.5.2'); in qtranslate.php … the plugin would have worked in 3.5.2 without this update, obviously.

    I had no time even for my own web dev hobbies lately. I should make time to release my qtranslate improvements given that I said I would, my apologies for the non-honored hope. I should hope that’ll happen this month.

    I need at least someone else to test it though before posting/releasing (it’s now too integrated with my plugin) so whoever is interested please email me at [ redacted ].

    Cheers.

    Thread Starter normadize

    (@normadize)

    Thread Starter normadize

    (@normadize)

    foreach loops with references (to modify directly the contents of arrays/objects) is definitely supported and has been supported for the longest time: http://php.net/manual/en/control-structures.foreach.php

    The following tests were done on PHP 5.3.23, but should work just the same for lower versions.

    $a = array ('foo', 'bar');
    foreach ($a as &$value)
        $value .= ' here!';

    Outputs, as expected:

    Array
    (
        [0] => foo here!
        [1] => bar here!
    )

    Same with objects:

    class A {
        public $foo = 'foo';
        public $bar = 'bar';
    }
    $a = new A;
    foreach ($a as &$prop)
        $prop .= ' here!';
    print_r($a);

    Outputs, as expected:

    A Object
    (
        [foo] => foo here!
        [bar] => bar here!
    )

    It seems there’s something fishy on your end.

    Thread Starter normadize

    (@normadize)

    @leoloso: what version of PHP are you using? I never had that issue with PHP 5.3 or PHP 5.4. Arrays or objects can be used with references in foreach() and the iterator var would be a reference to the actual array value or object property (faster for big and nested stuff).

    Thread Starter normadize

    (@normadize)

    I’ll try to find time to do this but I’m pretty heavily swamped with work at the moment.

    Thread Starter normadize

    (@normadize)

    Still present in v3.4.1 …

    Thread Starter normadize

    (@normadize)

    Well, you can always hack the plugin code to fix it, e.g. suppress the error by using @, but I reported it so that the plugin author fixes it for everyone.

    I this case, you can replace $url_block->header->args with @$url_block->header->args on line 115 in /W3/PageSpeed.php, and do the same trick for all other such errors.

    Thread Starter normadize

    (@normadize)

    Actually it’s best in your external cron not to set ?doing_wp_cron since that will cause wp-cron.php to avoid trying to obtain a lock. It’s best to either simply do:

    wget http://localhost/path/to/wp-cron.php

    Or, better yet, invoke php directly (the cli version):

    cd /path/to/wordpress/folder && php wp-cron.php

    Cheers.

Viewing 15 replies - 16 through 30 (of 78 total)